Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2012-04-13 22:19:29
Size: 174
Editor: JohnFlanagan
Comment:
Revision 3 as of 2012-04-13 22:24:25
Size: 580
Editor: JohnFlanagan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
To create a new Item3D widget use must inherit from EMItem3D (you will need to import this class from emitem3d). To create a new Item3D widget use must inherit from EMItem3D (you will need to import this class from emitem3d). EMItem3D is a new style class so you don't need to multiply inherit from object.

For exmaple:
{{{#!highlight python
class EMNewItem(EMItem3D):
    name = "myname"
    nodetype = "mynodetype"
    def __init__(self, parent=None, children=None, transform=None):
        if not Transform: transform=transform()
        EMItem3D.__init__(self,parent=parent,children=children,transform=transform)
}}}

Creating a new Item3D widget for use in EMScene3D

To create a new Item3D widget use must inherit from EMItem3D (you will need to import this class from emitem3d). EMItem3D is a new style class so you don't need to multiply inherit from object.

For exmaple:

   1 class EMNewItem(EMItem3D):
   2     name = "myname"
   3     nodetype = "mynodetype"
   4     def __init__(self, parent=None, children=None, transform=None):
   5         if not Transform: transform=transform()
   6         EMItem3D.__init__(self,parent=parent,children=children,transform=transform)

Eman2New3DItem (last edited 2012-04-16 23:13:18 by JohnFlanagan)