#1
|
|||
|
|||
Vizard 3 sensor plugin
I'm trying to port a Vizard 4 (sensor + extension) plugin I wrote to also work with Vizard 3.
So far I got all the basic sensor stuff working, but in vizard 4 I got access to some custom python functions for the tracker. I would also like to port these to the vizard 3 plugin but I can't figure out how to add the functionality. The sensor example code only uses the Command() function to recieve communication. The PythonPluging example does add some new python callable functions but I can't combine the two. Is there somewhere an example on how I could do all this? |
#2
|
|||
|
|||
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" 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); |
#3
|
|||
|
|||
What is the correct way of returning values in de command function, Vizard 4 had a nice .set() method. I can't seem to find something similar in the vizard 3 example codes.
I did see you could extend the float data array but I would also like to be able to return some strings with certain tracker error messages. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Realistic Light and Shadows Using Vizard and 3DS Max | jde | Vizard | 4 | 07-13-2012 10:58 AM |
Vizard 4 Beta Testing | farshizzo | Announcements | 0 | 02-01-2011 10:46 AM |
Vizard 4 Beta Testing | farshizzo | Vizard | 0 | 02-01-2011 10:46 AM |
Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 11:13 AM |
Vizard tech tip: Text to Speech | Jeff | Vizard | 1 | 01-15-2009 09:39 PM |