Wings 3D Development Forum
Zaribok: RenderMan exporter - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6)
+--- Thread: Zaribok: RenderMan exporter (/showthread.php?tid=47)

Pages: 1 2 3


RE: Zaribok: RenderMan exporter - nemyax - 01-17-2019

I've posted another update (0.3.20190116). It fixes scene light export, which crashed the plug in Wings 2.2.1.
For some reason the API's return value type for scene lights is now different from the one for default lights, so the plug works with both types.
There's also a new option for launching your favourite viewer to display your renders.


RE: Zaribok: RenderMan exporter - micheus - 01-17-2019

(01-17-2019, 07:54 AM)nemyax Wrote: For some reason the API's return value type for scene lights is now different from the one for default lights, so the plug works with both types.
In v2.2.1 Björng changed the way that value for scene lights is returned and that broke the render exporters - it's a know issue to be fixed.

I hope he could to add back a option to export the old way too.
In the mean time - if you don't care about the light names - then you could to check if the light's data contains its name or not. Then you plugin can work with both versions.

The old way the wpa:lights/1 would to return a list of light data like this:
[{Name, [{opengl,[{type,...},...]}|Props} | Ligths] :: ([{Name,Properties},..])
and now it's returning this way:
[[{opengl,[{type,...},...]}|Props] | Ligths] :: ([Properties,..])


RE: Zaribok: RenderMan exporter - nemyax - 01-17-2019

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.