07-21-2016, 01:26 PM
Micheus,
Remember that before Wings 2.x, it was possible in the Material Properties dialog to add Modulators for a material by clicking "New Modulator". If this was possible again, would that give David what he needs? Maybe that is still not possible with wxwidgets... David, Install a Wings 1.5.x version to see if that would be what you want. oort
David, since the DEF_RENDER_PASS* are defined as disabled, there is no need for that sequence of defines.
This sequence bellow - in export_prefs() - also doesn't need to be that way: Quote: {render_pass1,?DEF_RENDER_PASS1}, it was my bad use a tuple instead of an atom as id for the new fields as I suggested you: Code: RenderPass = In that code I suggested you, replace it by: Code: RenderPass = That way you can go back to the logic I tried to suggest before and have less code to write.
The old code updated, just for reference:
Code: %% Render
07-21-2016, 01:56 PM
(This post was last modified: 07-21-2016, 02:22 PM by david.bluecame.)
Hello,
With the "individual items" code I got Render Passes working :-) (although it requires some changes I made to Core that will be available in the upcoming YafaRay v3.0.1-beta) I will try later Micheus' latest changes to optimize the code. Some examples :-) Combined pass (typical pass as you know it) Z-depth pass: Debug pass - Normals Direct diffuse only pass Indirect light pass: Refraction pass: Reflection pass: Hello, Micheus. When I tried your latest code I initially got this during compilation: erlc -Werror -pa ../../ebin -pa ../../intl_tools -I ../../intl_tools -I ../../src -I ../../e3d +debug_info -o../../plugins/import_export wpc_yafaray.erl wpc_yafaray.erl:2198: syntax error before: '}' wpc_yafaray.erl:2190: function export_prefs/0 undefined I found an extra "}" in the line Acc++[list_to_atom(Id),?DEF_RENDER_PASS}] So I changed it to: Acc++[list_to_atom(Id),?DEF_RENDER_PASS] It compiles but then I get this error in runtime when I try to enter the Render->YafaRay window: wpc_yafaray:command/3: bad return value: {'EXIT', {badarg, [{erlang,list_to_atom, [[114,101,110,100,101,114,95,112, 97,115|...]], []}, {wpc_yafaray, '-export_prefs/0-fun-0-',2, [{file,"wpc_yafaray.erl"}, {line,2198}]}, {lists,foldl,3, [{file,"lists.erl"},{line,1262}]}, {wpc_yafaray,export_prefs,0, [{file,"wpc_yafaray.erl"}, {line,2196}]}, {wpc_yafaray,export_dialog,2, [{file,"wpc_yafaray.erl"}, {line,2190}]}, {wings_develop,time_command,2, [{file,"wings_develop.erl"}, {line,81}]}, {wings_plugin,command,3, [{file,"wings_plugin.erl"}, {line,139}]}, {wings,raw_command_1,3, [{file,[...]},{line,...}]}]}} I agree it's much nicer and good practice to do this as an array, with much more compact and scalable code. However, it's too much effort I think, and as it's already working with the "independent" items code I would suggest to keep it that way. If the multiple defines are not needed, can I just use the same for all the render_passXX atoms?
David, for your information...
in the line: {menu, render_pass_menu(), get_pref(render_pass1,Attr), [{key,render_pass1}]} in plugins we must to use the key() function: {menu, render_pass_menu(), get_pref(render_pass1,Attr), [key(render_pass1)]} that is because it can happens different plugins to use an Id with same name, so by using the key/1 function we are introducing a plugin id and your render_pass1 will become {yafaray,render_pass1} (that yafaray comes from ?TAG and you can find the code at the begin of the source code). About the code problem, I'm just coding it now and I will check the problem.
07-21-2016, 02:40 PM
Hello,
I changed the defines and updated the atom assignments to the defines. It seems to be working fine still. I've updated my github code. However, when I do the change you suggest in your last post, it no longer saves the changes when I click ok (??)
07-21-2016, 02:42 PM
This fix the problem:
Code: RenderPass =
07-21-2016, 02:47 PM
(This post was last modified: 07-21-2016, 02:52 PM by david.bluecame.)
About the key, I noticed most of the GUI items use the "key,atom" and at the end of the panel they add "key(pnl....)"
So, I've made this change and still seems to work: [...] {hframe, [ {label,?__(202,"Render pass32")}, {menu, render_pass_menu(), get_pref(render_pass32,Attr), [{key,render_pass32}]} ]} ],[key(pnl_render_passes)]} Would that be acceptable? I've updated my github code with that. (07-21-2016, 02:47 PM)david.bluecame Wrote: About the key, I noticed most of the GUI items use the "key,atom" and at the end of the panel they add "key(pnl....)"Id's that are not plugin specific (for some controls like tabs, frames) we can use that way. It can be possible there are some "lost" Id's using the "wrong" way, but as soon I put my eyes on them I change. last year I had reviewed all three render plugins and tried to make them as most similar (standardised) as possible. ---- About the code, let's do that way... (if that is not a problem for you ) You keep working on the version your get work and I work on it to replace the code to be "optimized" adjusted to be in accord with the other part of the source. I tried to render a simple cube and set three passes only then - after start - yafaray crashed (got Windows freezing dialog) with this in the wings3d log: Code: Erlang/OTP 19 [erts-8.0] [64-bit] [smp:1:1] [async-threads:10] |
|