WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-11-2011, 08:52 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Sorry I forgot to mention that. You definitely need to compile the plugins using Visual Studio 2008.

We're hoping to finalize the new plugin interface before the final release. When that's ready there will be a more complete example of how to interact with your plugin objects from the Python script. The old style plugins will still be compatible though.
Reply With Quote
  #2  
Old 02-12-2011, 07:01 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Quote:
Originally Posted by farshizzo View Post
We're hoping to finalize the new plugin interface before the final release. When that's ready there will be a more complete example of how to interact with your plugin objects from the Python script.
Ah, such a more complete example will definately be very welcome. I've just been experimenting with adding my own functions to the CustomDrawable object in the example code (my final aim is to provide to Vizard a rather extensive rendering library I normally use with a GLUT based program, so all I want to do is write a interface/wrapper).

This came out to be rather complicated Am I doing this right? The below code shows the growing exprression (i send the pointers to cout to still if they're still valid or I've made a mistake).
Code:
cout << ((VizCustomNodeObj*)custom)->node << endl;
cout << osg::dynamic_pointer_cast<osg::Geode>(((VizCustomNodeObj*)custom)->node) << endl;
cout << osg::dynamic_pointer_cast<osg::Geode>(((VizCustomNodeObj*)custom)->node)->getDrawableList()[0] << endl;
cout << osg::dynamic_pointer_cast<CustomDrawable>(osg::dynamic_pointer_cast<osg::Geode>(((VizCustomNodeObj*)custom)->node)->getDrawableList()[0]) << endl;
osg::dynamic_pointer_cast<CustomDrawable>(osg::dynamic_pointer_cast<osg::Geode>(((VizCustomNodeObj*)custom)->node)->getDrawableList()[0])->ToggleAnimate();
I can now toggle whether the example object is stretched or not :P

Best,
Dee
Reply With Quote
  #3  
Old 02-12-2011, 07:05 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Oh, I have another question:
How do I communicate fatal, execution-halting errors to Vizard from my plugin? As there's C code in between, I can't throw exceptions (right?), so how can I make Vizard stop execution from my plugin then (I know I can send info to stdout from the plugin, so I don't need a way to send a message along as well, just the execution halt)?

Thanks!
Dee
Reply With Quote
  #4  
Old 02-12-2011, 10:09 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Ah, another thing I hope you could add to the documentation:

The plugin is compiled with _SECURE_SCL=0. This means that if you call functions in libraries that also take stl containers, those libraries also have to be compiled with preprocessro definition set. Otherwise, vectro has a different size and you get difficult to trace errors (I just spent a few hours on this)...

Best,
Dee
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC