WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Copy light object (https://forum.worldviz.com/showthread.php?t=4191)

kovitch 04-03-2012 10:45 AM

Copy light object
 
Hi,

I'am trying to copy light objects by using the following code:

Code:

general_light= viz.addLight()
general_light.position(11.496,4.195,2.63)
general_light.direction(0,-1,0)
general_light.spread(180)
general_light.intensity(1)
general_light.spotexponent(3)

light_1 = general_light.copy()
light_1.setPosition(11.496,4.195,5.63)
light_2 = general_light.copy()
light_2.setPosition(11.496,4.195,7.289)

...and I get the error:
** ERROR: Failed to copy node
** ERROR: Failed to copy node

Is there any special way to copy a light object?

Best regards,

Alex.

farshizzo 04-04-2012 04:57 PM

No, this is not currently supported. In your specific case you can define a function that creates the light and sets the parameters:
Code:

def addGeneralLight():
        general_light= viz.addLight()
        general_light.position(11.496,4.195,2.63)
        general_light.direction(0,-1,0)
        general_light.spread(180)
        general_light.intensity(1)
        general_light.spotexponent(3)
        return general_light

light_1 = addGeneralLight()
light_1.setPosition(11.496,4.195,5.63)
light_2 = addGeneralLight()
light_2.setPosition(11.496,4.195,7.289)



All times are GMT -7. The time now is 12:24 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC