Hi all.
I am taking my first steps at object oriented, and i'm
trying to build a tool to aid me in the lighting process.

i want to list all my Vray lights in a QTableWidget and some of its 
attributes 
so i can change them more easily.

I have made a base class with all the methods of the Tool UI and its 
working fine.

I also created another class Light() with all the Light parameters and 
methods.
The thing is i wanted (if possible) to instantiate as many Light() objects 
as there are in the scene
so i can refer to them in the UI when changing values. But this has to be 
dynamic, i mean.

hope you see what i mean. All the examples i have seen are static 
instantiation like a = light()

in the following example i can only reach to one object. In this case the 
last one to be created.

Maybe it's my methodology that is wrong in the first place. How would you 
go about this
Thanks in advance.

Best 
Ric

-----------------------------------------------------------------------------

import pymel.core as pm

class lightObject():

    def __init__(self,name):

        self.name = name

        self.color = (255,255,255)

    def __repr__(self):

        return self.name



lights = pm.ls(shapes=1)

for light in lights:

    if light.nodeType() == "VRayLightRectShape" or light.nodeType() == 
"VRayLightDomeShape":

    lightNode = lightObject("%s" %light)






-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/045c727c-ac97-4fbf-8ceb-a89d240d6f86%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to