Author Topic: Corona Light Select Manager Script & Nuke Light Mixer Scripts  (Read 467 times)

2019-01-17, 03:22:18

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile
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.




2019-01-17, 16:24:41
Reply #1

Prazno

  • Users
  • *
  • Posts: 2
    • View Profile
It looks great! I am testing it and I do not find any problem so far

2019-01-18, 22:54:33
Reply #2

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile

2019-01-25, 17:49:52
Reply #3

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile
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.

2019-02-01, 15:58:45
Reply #4

sequana

  • Active Users
  • **
  • Posts: 45
    • View Profile
it crashes everytime i want to add a light to an existing Lightselect Element via the "+" button!

A" border="0
Windows 10 - Max 2018 - Corona 2.0 /// Arch- & Product VIZ

2019-02-01, 16:59:51
Reply #5

Sandrineee

  • Active Users
  • **
  • Posts: 16
    • View Profile
Whoua ! Very impressed of the compo in nuke. Very cleared and frendly with the script.
Thanks guys ! :)

2019-02-01, 18:24:27
Reply #6

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile
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.

2019-02-04, 11:14:01
Reply #7

sequana

  • Active Users
  • **
  • Posts: 45
    • View Profile
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
Windows 10 - Max 2018 - Corona 2.0 /// Arch- & Product VIZ

2019-02-04, 18:59:30
Reply #8

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile
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.

2019-02-05, 14:21:55
Reply #9

sequana

  • Active Users
  • **
  • Posts: 45
    • View Profile
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.
« Last Edit: 2019-02-05, 14:33:56 by sequana »
Windows 10 - Max 2018 - Corona 2.0 /// Arch- & Product VIZ

2019-02-05, 18:34:40
Reply #10

makco

  • Active Users
  • **
  • Posts: 17
    • View Profile
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.