Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Corona Goodies - User Contributions => Topic started by: makco on 2019-01-17, 03:22:18

Title: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-01-17, 03:22:18
We have just finished developing a couple of scripts that we wanted to share with the hope that they can be useful to others.

We are big fans of the light mixer and is already an amazing tool as it stands... we found a few things, however, that could make its usage a bit more efficient and convenient, so we wrote two scripts.

Below is a video showing how they work:


The scripts are attached here.
We have used them already in a few projects and it has been very useful, especially in Nuke, but also to make the process in 3dsmax a bit easier.
If you are installing the python script on nuke you need to add the following lines to your menu.py:

Code: [Select]
import LightMixer

nuke.menu('Nuke').addCommand('Scripts/Light_Mixer', 'LightMixer.LightMixers()')
nuke.menu('Nuke').addCommand('Scripts/SHuffle_Channels', 'LightMixer.ChMask()')
nuke.menu('Nuke').addCommand('Scripts/Shuffle_All', 'LightMixer.AllChan()')


If you do use it please let us know what you think.
We will hope to post any updated versions and a bit more info in the blog of our website at Moso Studio.

M.



Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: Prazno on 2019-01-17, 16:24:41
It looks great! I am testing it and I do not find any problem so far
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-01-18, 22:54:33
Glad you are trying it!
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-01-25, 17:49:52
In case anyone is using this, below is a link with the scripts (lightselect for 3dsmax has been updated, just drag on the viewport and should then be up-to-date).
We just fixed a little issue happening when lights get deleted after render light select elements are created.(as corona keeps a ghost of the deleted light with the name deleted on the list).

https://www.dropbox.com/sh/te144s36zuuygtu/AABMb-05DZfuIRcARbhV6R_xa?dl=0


M.
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: FlorianW. on 2019-02-01, 15:58:45
it crashes everytime i want to add a light to an existing Lightselect Element via the "+" button!

(https://i.ibb.co/K0fwWWT/A.jpg) (https://ibb.co/bWCJXXc)
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: SandrineC on 2019-02-01, 16:59:51
Whoua ! Very impressed of the compo in nuke. Very cleared and frendly with the script.
Thanks guys ! :)
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-02-01, 18:24:27
Sequana,

Are you using the latest version that is on the dropbox? If you are, can you take a look at the maxscript listener error and send me a capture of that?
And if possible send me the scene (only the lights) I will take a look...  I can't seem to replicate the error here.

Thanks,

M.
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: FlorianW. on 2019-02-04, 11:14:01
Quote
-- Error occurred in anonymous codeblock; filename: C:\Users\workstation\Documents\3dsMax\downloads\Light Select.mzp; position: 8687; line: 332
-- MAXScript Rollout Handler Exception:
-- Runtime error: replace end out of range: 8
-- MAXScript callstack:
--   thread data: threadID:2476
--   ------------------------------------------------------
--   [stack level: 0]
--   In plus.pressed(); filename: C:\Users\workstation\Documents\3dsMax\downloads\Light Select.mzp; position: 8688; line: 332
--   member of: Rollout:add_Corona_mask
--      Locals:
--         plusLights: #($CoronaLight:CoronaLight003 @ [39.252331,-60.571831,0.000000])
--         tempName: undefined
--         sel: 1
--         id: 1
--         seltxt: "LSE_Top"
--         temp: ReferenceTarget:CShading_LightSelect
--         CurrentNodes: #()
--      Externals:
--         UpdateElements: Global:UpdateElements : UpdateElements()
--         lbx7: RolloutControl:lbx7 in rollout:add_Corona_mask : ListBoxControl:lbx7
--         allLightsNames: Global:allLightsNames : #("CoronaLight003")
--         lElemNames: Global:lElemNames : #("LSE_Top", "Lselect_Env")
--         allGeoNames: Global:allGeoNames : #()
--         RemoveLights: Global:RemoveLights : RemoveLights()
--         lbx1: RolloutControl:lbx1 in rollout:add_Corona_mask : ListBoxControl:lbx1
--         lbx10: RolloutControl:lbx10 in rollout:add_Corona_mask : ListBoxControl:lbx10
--         owner: Rollout:add_Corona_mask
--         getUnassignedLights: Global:getUnassignedLights : getUnassignedLights()
--         getUnassignedGeo: Global:getUnassignedGeo : getUnassignedGeo()
--         re: Global:re : <MixinInterface:RenderElementMgr>
--         add_Corona_mask: Rollout:add_Corona_mask
--         findReElement: Global:findReElement : findReElement()
--         chk1: RolloutControl:chk1 in rollout:add_Corona_mask : CheckBoxControl:chk1
--   ------------------------------------------------------
--   [stack level: 1]
--   called from top-level
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-02-04, 18:59:30
Sequana,

Thanks for sending this.
I found the issue, was due to the fact that your render element names were not the same as the ones the script created. I created an exception for these instances, so you can still use your names and script will not fail.
Please download the latest version here, and let me know if this works now.
https://www.dropbox.com/s/cpdl7m88sd97w9h/Light%20Select.mzp?dl=0

M.
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: FlorianW. on 2019-02-05, 14:21:55
okay, works now but there is another weird thing going on.

Why is your script renaming lights when added to lselects?

for eg; I have "CoronaLight001" in the scene and put it on a Lightselectelement "LSE_Top". Then i create another Light called "CoronaLight002", but when i put it on that "LSE_Top" with the "+" button the light suddendly is renamed to "CoronaLight_02". And when i create a third light "CoronaLight003" and press the "+" button a messagebox comes up, duplicates were found, which is impossible because there was no light with that name ever in the scene.
Title: Re: Corona Light Select Manager Script & Nuke Light Mixer Scripts
Post by: makco on 2019-02-05, 18:34:40
Hi Sequana,

Yes the renaming feature can be a bit bothersome, and gets a bit messy when lights get removed and added to different light select elements; I included a checkbox (by default off) to avoid renaming the lights; I also added a Warnings off checkbox... to keep them off if you don't want to see them.
https://www.dropbox.com/s/cpdl7m88sd97w9h/Light%20Select.mzp?dl=0

But actually, that message about the duplicates was referring to something else.. if you see on the top there is a checkbox to "Prevent Duplicates", the point of this is that if you have your render element LSE_Top and have  lights A, B and C on it and then you create a new light select element lets say LSE_Bottom and add light A (that was already on LSE_Top) it will remove it from LSE_Top to prevent having the same light in two different light select elements (this is because of our workflow later in NUKE) however if you do not care and purposely want to have lights A, B and C on two light select elements, then you need to turn the first checkbox of the script "Prevent Duplicates".

Hope this was clear, and thanks for the feedback.

M.