01-17-2019, 11:50 AM
Yes, I worked around it like this:
Code:
gather_lights(St) ->
MaybeLights = wpa:lights(St),
SceneLights = wings_pref:get_value(scene_lights),
Lights = if
MaybeLights =:= []; SceneLights =:= false ->
wings_light:export_camera_lights();
true -> MaybeLights end,
gl0(Lights, 0, []).
gl0([], _, Result) -> Result;
gl0([{Name,Props}|T], NumSuf, Result) ->
gl0(T, NumSuf, gl1(Name, Props, Result));
gl0([Props|T], NumSuf, Result) when is_list(Props) ->
gl0(T, NumSuf + 1, gl1("light" ++ integer_to_list(NumSuf), Props, Result)).
gl1(Name, Props, Result) ->
case proplists:get_value(visible, Props) of
true -> [{Name,Props}|Result];
_ -> Result end.