User Tools

Site Tools


eman2:new3ditem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

eman2:new3ditem [2025/06/19 21:02] – created steveludtkeeman2:new3ditem [2025/06/19 21:03] (current) steveludtke
Line 9: Line 9:
  
 For exmaple: For exmaple:
-<code>#!highlight python+<code python>
 class EMNewItem(EMItem3D): class EMNewItem(EMItem3D):
     name = "myname"     name = "myname"
Line 34: Line 34:
  
 First add a static function to generate a dialog box to aid the user in adding an instance of this widget to the scene graph: First add a static function to generate a dialog box to aid the user in adding an instance of this widget to the scene graph:
-<code>#!highlight python+<code python>
 class EMNewItem(EMItem3D): class EMNewItem(EMItem3D):
     @staticmethod     @staticmethod
Line 52: Line 52:
 Then you need to add another static function to actually generate an instance of this widget. In this example the fist argument to EMNewItem constructor is for this example, but the last argument is mandatory. Then you need to add another static function to actually generate an instance of this widget. In this example the fist argument to EMNewItem constructor is for this example, but the last argument is mandatory.
  
-<code>#!highlight python+<code python>
 class EMNewItem(EMItem3D): class EMNewItem(EMItem3D):
     @staticmethod     @staticmethod
Line 61: Line 61:
 Next you need to add a few lines of code to the NodeDialog class in emscene3d.py, in two functions: Next you need to add a few lines of code to the NodeDialog class in emscene3d.py, in two functions:
  
-<code>#!highlight python+<code python>
 class NodeDialog(QtGui.QDialog): class NodeDialog(QtGui.QDialog):
    def %%__%%init%%__%%(self, inspector, item):    def %%__%%init%%__%%(self, inspector, item):
Line 91: Line 91:
  
 For Example: For Example:
-<code>#!highlight python+<code python>
 class EMNewItemInspector(EMInspectorControlShape): class EMNewItemInspector(EMInspectorControlShape):
     def %%__%%init%%__%%(self, name, item3d):     def %%__%%init%%__%%(self, name, item3d):
eman2/new3ditem.txt · Last modified: by steveludtke