Announcement

Collapse
No announcement yet.

Converting Light Copies to Instances

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

  • Converting Light Copies to Instances

    Hi,

    I was looking for a script and founded this one on THE AREA is working fine for converting objects from copies to instances, BUT not for lights...in the selection window they arent show, i guess i should change in the following code the GeometrClass for something like LightClass, but isnt working so not so easy

    Code:
    fn flt obj = isKindOf obj GeometryClass
    
    src = selectByName title:"Select source" filter:flt single:true
    
    dst = selectByName title:"Select copies" filter:flt
    
    for i in dst do instanceReplace i src
    Some ideas??
    Last edited by peprgb; 10-11-2012, 09:24 AM.

  • #2
    Mmmm no one???

    Comment


    • #3
      ditch the "filter:flt" from the two middle lines and it'll no longer use the filter that only allows geometry.

      As another way, If your master light in your scene is called light_001 for example you can use:

      Code:
      -- leave the dollar sign in here and change the name of the object to whatever object you want everything to switch to
      
      masterObj= $light_001
      
      for i = 1 to selection.count do
      (
      	selection[i].baseobject = masterObj.baseobject
      )

      Comment


      • #4
        ditch the "filter:flt" from the two middle lines and it'll no longer use the filter that only allows geometry.

        As another way, If your master light in your scene is called light_001 for example you can use:

        Code:
        -- leave the dollar sign in here and change the name of the object to whatever object you want everything to switch to
        
        masterObj= $light_001
        
        for i = 1 to selection.count do
        (
        	selection[i].baseobject = masterObj.baseobject
        )

        Comment


        • #5
          Thank you very very much joconell, both methods are working fine!!

          Comment


          • #6
            Glad to help!

            Comment


            • #7
              Hi guys,
              just found this...is there a way to just make the master object which ever is selected first or something like that so that I don't have to change the name of the master object everytime. Usually when I want to make lights instanced they are the same anyway but just not instanced so I don't care which one is master.
              Thx
              www.hrvojedesign.com

              Comment


              • #8
                Code:
                for i = 2 to selection.count do ( selection[i].baseobject = selection[1].baseobject )

                Comment

                Working...
                X