View Single Post
  #2  
Old 08-30-2012, 10:44 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Are you referring to customizing the extension interface within the C++ plugin using the Python_SetExtensionCode function? If so, you can still customize the interface in Vizard 3.0. Instead of using Python_SetExtensionCode, you need to use PyRun_SimpleString. You also need to add the following to the end of the code string:
Code:
"viz.upgradeExtension('myextension.dle',MyExtension)\n"
Where myextension.dle is replace with the name of your plugin file and MyExtension is the name of your custom extension class. Here is a more complete example:
Code:
char *code = "class MyExtension(viz.VizExtension):\n"
             "    def mymethod(self, value):\n"
             "        self.command(1,'',value)\n"
             "viz.upgradeExtension('myextension.dle',MyExtension)\n";
PyRun_SimpleString(code);
Reply With Quote