Announcement

Collapse
No announcement yet.

RE_Light_Select - Automated?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RE_Light_Select - Automated?

    Heya

    Em just went through youtube vids and have to say that that RE_Light_Select got my attention, something similar to Vue 9 relighting engine...

    But I kinda hit the wall so I was hoping that maybe some1 nice would script it or chaosgroup would add it later on...

    Basically listing 100+ lights in render elements would take ages so I'll appreciate to get some script to list all selected lights plox...


    From other hand any plans for adding indirect illumination and so on ? And caustics...and shadows...and everything else we can stick in ;O
    Last edited by Dariusz Makowski (Dadal); 07-12-2010, 09:46 PM.
    CGI - Freelancer - Available for work

    www.dariuszmakowski.com - come and look

  • #2
    When I upgrade to Vray 2 at the end of the week I'll write a script for this, should be fairly easy.
    Maxscript made easy....
    davewortley.wordpress.com
    Follow me here:
    facebook.com/MaxMadeEasy

    If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

    Comment


    • #3
      Blass you ! Thanx let me know when u finish plz : )
      CGI - Freelancer - Available for work

      www.dariuszmakowski.com - come and look

      Comment


      • #4
        I'll do it as well if Dave doesn't get to it. Once I get 2.0.
        Colin Senner

        Comment


        • #5
          I've written the basics of it, but not on 2.0 yet...

          If someone who has Vray 2.0 can type this into the Maxscript listener and paste the output here please I'll finish making it, just need to know the correct property.

          Showproperties VrayLightSelect()
          Maxscript made easy....
          davewortley.wordpress.com
          Follow me here:
          facebook.com/MaxMadeEasy

          If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

          Comment


          • #6
            Showproperties VrayLightSelect()
            -- No ""showProperties"" function for VRayLightSelect
            GHiOM = Guillaume Gaillard
            freelance 3D artist
            www.ghiom.com

            Comment


            • #7
              Sorry

              Showproperties (VrayLightSelect())


              I'm just guessing the name, but should be correct I'd imagine...
              Maxscript made easy....
              davewortley.wordpress.com
              Follow me here:
              facebook.com/MaxMadeEasy

              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

              Comment


              • #8
                Showproperties (VrayLightSelect())
                .enabled : boolean
                .filterOn : boolean
                .atmosphereOn : boolean
                .shadowOn : boolean
                .elementName : string
                .bitmap : bitmap
                .vrayVFB : boolean
                .color_mapping : boolean
                .multiplier : float
                .lights : node array
                .lights_exclude_type : integer
                false

                Comment


                • #9
                  OK basic version to test... Haven't got Vray 2 to test it with but syntax should hopefully be ok.... should work in all max versions.

                  LightSelect_Element_maker.zip
                  Maxscript made easy....
                  davewortley.wordpress.com
                  Follow me here:
                  facebook.com/MaxMadeEasy

                  If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                  Comment


                  • #10
                    Made change so you can choose to add selected lights as one Light Select Render Element instead of having a Render Element per light. It's got a basic incremental numbering system built in but it might cause duplicates if you run it on seperate sessions.


                    Code:
                    --Light Select Render Element Maker
                    --Written by Dave Wortley
                    --Version 0.2
                    --Untested
                    --
                    --Makes a Light Select Render Element per chosen Light.
                    
                    try(DestroyDialog DW_LightSelect) catch()
                    
                    AR_lightList = #()
                    AR_LightSelect = #()
                    P = 1
                    
                    rollout DW_LightSelect "Light Select Render Element Maker" width:297 height:300
                    (
                    	listbox lbx_allLights "All Lights" pos:[6,10] width:127 height:17
                    	listbox lbx_selectLights "Selected Lights" pos:[162,8] width:127 height:17
                    	button btn_add ">" pos:[138,31] width:20 height:44
                    	button btn_Remove "<" pos:[138,80] width:20 height:44
                    	button btn_make "RE per Light" pos:[134,258] width:157 height:17
                    	button btn_all "All" pos:[138,128] width:20 height:44
                    		
                    	button btn_makeMulti "Add selected as one RE" pos:[133,279] width:156 height:17
                    	on DW_LightSelect open do
                    	(
                    	
                    		for o in objects where superclassof o == light do append AR_lightList o.name
                    		lbx_allLights.items = AR_LightList
                    		
                    	
                    	)
                    	on btn_add pressed do
                    	(
                    		--add
                    		if lbx_allLights.selected != undefined then
                    		(
                    			append AR_LightSelect lbx_allLights.selected
                    			lbx_selectLights.items = AR_LightSelect
                    			
                    			deleteItem AR_LightList lbx_allLights.selection
                    			lbx_allLights.items = AR_LightList
                    		)
                    	)
                    	on btn_Remove pressed do
                    	(
                    		--remove
                    		if lbx_selectLights.selected != undefined then
                    		(
                    			append AR_LightList lbx_selectLights.selected
                    			lbx_allLights.items = AR_LightList
                    			
                    			deleteitem AR_LightSelect lbx_allLights.selection
                    			lbx_selectLights.items = AR_LightSelect
                    		)
                    		
                    	)
                    	on btn_make pressed do
                    	(
                    		--make elements
                    		theManager = maxOps.GetRenderElementMgr #Production
                    	
                    		--for o in selection where superclassof o == Light do
                    		for o in AR_LightSelect do
                    		(
                    			theManager.AddRenderElement (VrayLightSelect elementname:("LightSelect_" + o + "_") lights:#((getnodebyname o)))
                    			--print (getnodebyname o)
                    		
                    		)
                    		
                    		--Messagebox (AR_LightSelect.count as string + " Light Select Elements Created")
                    		
                    	)
                    	on btn_all pressed do
                    	(
                    		--add all
                    		if lbx_allLights.items.count != 0 then
                    		(
                    			for i = 1 to lbx_allLights.items.count do
                    			(
                    				append AR_Lightselect lbx_allLights.items[i]
                    				lbx_selectLights.items = AR_LightList
                    			)
                    			AR_LightList = #()
                    			lbx_allLights.items = AR_LightList
                    		)
                    		
                    	)
                    	on btn_makeMulti pressed do
                    	(
                    		--make elements
                    		theManager = maxOps.GetRenderElementMgr #Production
                    		
                    		AR_MultiLights = #()
                    		for o in AR_LightSelect do append AR_MultiLights (getnodebynameo)		
                    		
                    		theManager.AddRenderElement (VrayLightSelect elementname:("LightSelect_" + (formattedprint P format: "02d") + "_") lights:AR_MultiLights)
                    		--print ("LightSelect_" + (formattedprint P format: "02d") + "_")
                    		P += 1
                    	)
                    )
                    
                    CreateDialog DW_LightSelect
                    Maxscript made easy....
                    davewortley.wordpress.com
                    Follow me here:
                    facebook.com/MaxMadeEasy

                    If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                    Comment


                    • #11
                      Haaa wow love u ! How do I use it now ?

                      U so good in it any chance to get that thing for mate too ? ^_^ Select object > mate? ^^
                      CGI - Freelancer - Available for work

                      www.dariuszmakowski.com - come and look

                      Comment


                      • #12
                        Just goto Maxscript ->new script, copy and paste that into a new script, and then select-all (in the editor) and drag the text onto the toolbar and it'll make you a button to use it with.

                        Once run it'll automatically populate the left list with all the lights and then you just add the lights you want to have as light selects, pressing the first button will make a render element per light, or if you want to have say 5 lights in one pass then just add them to the list and then press the 2nd button, and it'll make one RE with all the selected lights in one pass.
                        Maxscript made easy....
                        davewortley.wordpress.com
                        Follow me here:
                        facebook.com/MaxMadeEasy

                        If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                        Comment


                        • #13
                          Thanks you it's working !
                          Now we can think about the workflow and options it's needed .

                          Can we supposed to use layers also ? I'm usual to group my lights in differents layer.
                          GHiOM = Guillaume Gaillard
                          freelance 3D artist
                          www.ghiom.com

                          Comment


                          • #14
                            Will have a look at doing layers as well... I can probably just add a button for use selection instead... then you can just select the layer contents and do it that way....

                            Any more feedback welcome...
                            Maxscript made easy....
                            davewortley.wordpress.com
                            Follow me here:
                            facebook.com/MaxMadeEasy

                            If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                            Comment


                            • #15
                              Ok added options for using selection... should mean u can set it up according to layers pretty easily. You can select a whole layer and it will only process the lights, no need to only select lights.

                              Code:
                              --Light Select Render Element Maker
                              --Written by Dave Wortley
                              --Version 0.3
                              --
                              --Makes a Light Select Render Element per chosen Light.
                              --
                              --Version History
                              --Added ability to use selection
                              --Add all lights as combined 
                              --Initial Version
                              
                              try(DestroyDialog DW_LightSelect) catch()
                              
                              AR_lightList = #()
                              AR_LightSelect = #()
                              P = 1
                              
                              rollout DW_LightSelect "Light Select Render Element Maker" width:297 height:300
                              (
                              	listbox lbx_allLights "All Lights" pos:[6,10] width:127 height:17
                              	listbox lbx_selectLights "Selected Lights" pos:[162,8] width:127 height:17
                              	button btn_add ">" pos:[138,31] width:20 height:44
                              	button btn_Remove "<" pos:[138,80] width:20 height:44
                              	button btn_make "RE per Light" pos:[134,258] width:157 height:17
                              	button btn_all "All" pos:[138,128] width:20 height:44
                              		
                              	button btn_makeMulti "Add selected as one RE" pos:[133,279] width:156 height:17
                              	button btn_Selection "Sel" pos:[138,176] width:20 height:44
                              	on DW_LightSelect open do
                              	(
                              	
                              		for o in objects where superclassof o == light do append AR_lightList o.name
                              		lbx_allLights.items = AR_LightList
                              		
                              	
                              	)
                              	on btn_add pressed do
                              	(
                              		--add
                              		if lbx_allLights.selected != undefined then
                              		(
                              			append AR_LightSelect lbx_allLights.selected
                              			lbx_selectLights.items = AR_LightSelect
                              			
                              			deleteItem AR_LightList lbx_allLights.selection
                              			lbx_allLights.items = AR_LightList
                              		)
                              	)
                              	on btn_Remove pressed do
                              	(
                              		--remove
                              		if lbx_selectLights.selected != undefined then
                              		(
                              			append AR_LightList lbx_selectLights.selected
                              			lbx_allLights.items = AR_LightList
                              			
                              			deleteitem AR_LightSelect lbx_allLights.selection
                              			lbx_selectLights.items = AR_LightSelect
                              		)
                              		
                              	)
                              	on btn_make pressed do
                              	(
                              		--make elements
                              		theManager = maxOps.GetRenderElementMgr #Production
                              	
                              		--for o in selection where superclassof o == Light do
                              		for o in AR_LightSelect do
                              		(
                              			theManager.AddRenderElement (VrayLightSelect elementname:("LightSelect_" + o + "_") lights:#((getnodebyname o)))
                              			--print (getnodebyname o)
                              		
                              		)
                              		
                              		--Messagebox (AR_LightSelect.count as string + " Light Select Elements Created")
                              		
                              	)
                              	on btn_all pressed do
                              	(
                              		--add all
                              		if lbx_allLights.items.count != 0 then
                              		(
                              			for i = 1 to lbx_allLights.items.count do
                              			(
                              				append AR_Lightselect lbx_allLights.items[i]
                              				lbx_selectLights.items = AR_LightList
                              			)
                              			AR_LightList = #()
                              			lbx_allLights.items = AR_LightList
                              		)
                              		
                              	)
                              	on btn_makeMulti pressed do
                              	(
                              		--make elements
                              		theManager = maxOps.GetRenderElementMgr #Production
                              		
                              		AR_MultiLights = #()
                              		for o in AR_LightSelect do append AR_MultiLights (getnodebynameo)		
                              		
                              		theManager.AddRenderElement (VrayLightSelect elementname:("LightSelect_" + (formattedprint P format: "02d") + "_") lights:AR_MultiLights)
                              		--print ("LightSelect_" + (formattedprint P format: "02d") + "_")
                              		P += 1
                              	)
                              	on btn_Selection pressed do
                              	(
                              		--add selected lights
                              		AR_Lightselect = #()
                              		AR_lightList = #()
                              
                              		for o in objects where superclassof o == light do append AR_lightList o.name
                              		for o in selection where superclassof o == Light do 
                              		(
                              			append AR_Lightselect o.name
                              			deleteitem AR_LightList (finditem AR_LightList o.name)
                              			
                              		)
                              
                              		
                              		lbx_selectLights.items = AR_Lightselect
                              		lbx_allLights.items = AR_LightList
                              		
                              		
                              	)
                              )
                              CreateDialog DW_LightSelect
                              Maxscript made easy....
                              davewortley.wordpress.com
                              Follow me here:
                              facebook.com/MaxMadeEasy

                              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                              Comment

                              Working...
                              X