Everything related to SDK.
User avatar
By seghier
#395720
hi
in pymaxwell help :
Parameter: channel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead.
Default: Enabled.

in studio 4 channels state:
hdr image 1
same as background 1
active sky 2
disabled 0
for (illumination; reflection ; refraction) how the script know when i choose : "hdr image" or "same as background" where they have the same value : 1 ?
User avatar
By Brany
#395733
The problem here is that the "Same as Background" option is Stuido-only, so you can't set an environment layer state vale for "Same as Background" using the SDK. You only can set as "enabled"/"disabled"/"use active sky instead". getEnvironmentLayer returns "1" for "Same as Background" because we have to return a value, and we choose "1", but I understand it is really confusing.
User avatar
By seghier
#395734
thanks Brany ; what i don't understand why when the script read 'same as background' write in the new scene ' same as background' if i am not wrong ?
i use value 4 for same as background and the script now get the settings of the background and apply them if the user choose 'same as back..' to other layers and in studio the layer will be hdr (value 1) , but it work
User avatar
By Brany
#395749
I am not sure if I understand, but if you read and save the scene, the "Same as Background" will still work in the saved scene because you didn'd call setEnvironmentLayer(...) to set the layer state. Once you set the environment layer, you must only use 0 (disabled) 1 (enabled) or 2(active sky). If you use other values it won't change anything... but take into accunt that if the scene readed currently had the "Same as Background" option enabled from Studio, it will keep using it, no matter what you set from setEnvironmentLayer (0, 1 ,2 ,3, 20 or 1000) ;)

sceneA (environment layer IBL_LAYER_REFLECTION -> "Same as Background")
read sceneA
sceneA -> getEnvironmentLayer(IBL_LAYER_REFLECTION) -> returns 1
sceneA -> setEnvironmentLayer(IBL_LAYER_REFLECTION, ... 4, .... )
save sceneA to sceneB
read sceneB
sceneB -> getEnvironmentLayer(IBL_LAYER_REFLECTION) -> returns 1 (is still using the "Same as Background" option!)


PD: I have to check this, but it seems that if the layer was set to "Same as Background" in Studio, and then you open the scene in pymaxwell and set the environment layer state to whatever you want (0, 1 or 2), and save the scene to disk, when you open it in studio it still uses the "Same as Background" option. Am I right?
User avatar
By seghier
#395750
thanks Brany for explanation.
what i mean that in maxwell tool i used value 4 for same as background and the layer get all settings like background but with layer ' hdr image' because the script can't write a scene with layer 'same as background' as you told me.
----
Brany wrote:
Tue Oct 17, 2017 11:03 am
PD: I have to check this, but it seems that if the layer was set to "Same as Background" in Studio, and then you open the scene in pymaxwell and set the environment layer state to whatever you want (0, 1 or 2), and save the scene to disk, when you open it in studio it still uses the "Same as Background" option. Am I right?
it work ; just when the script read a scene with layer 'same as background' and write new scene ; in studio the layer become 'hdr image'
i don't remember before if that happen; but everything work fine

...and 3 Days later, 82.528 Views !!! ...NL, every[…]

Hello dear customers, We have just released a new[…]

grass generator extension

Just downloaded MWR5 for Rhino 6 and want to use g[…]

Hello everyone, I have a new bug with the latest M[…]