WorldViz User Forum  

Go Back   WorldViz User Forum > Plug-in development

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-05-2009, 03:27 PM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
Talking PyOpenGL plugin

For my custom-node learning exercise I hacked out a plugin for writing custom nodes in Python with PyOpenGL. Not too pretty, but it hardly ever crashes Vizard anymore.
In case anyone's interested...
Reply With Quote
  #2  
Old 10-05-2009, 03:43 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Sweet!

Does the custom node call a specified Python function from inside the draw method? If so, you will need to make sure the plugin acquires the Python global interpreter lock before triggering the Python code. This might be the cause of the crashes you mention. Example:
Code:
PyGILState_STATE pyGILState = PyGILState_Ensure();

//Run Python code

PyGILState_Release(pyGILState);
Reply With Quote
  #3  
Old 10-06-2009, 08:15 AM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
Red face

Yes, I've got all the Python calls properly wrapped in GIL Ensure()/Release() calls. I'm somewhat familiar with the Python C API (I did most of the work on the Python bindings for Syzygy, with SWIG and more recently SIP), but I find it so verbose and tedious that there's a strong temptation to be sloppy about validating the results...I think I've got it fixed up now...
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Vizard Sensor Plugin farshizzo Plug-in development 25 08-01-2019 01:24 AM
Live Characters plugin Frank Verberne Vizard 7 03-01-2012 03:23 AM
Howto debug a custom plugin? reedev Plug-in development 3 04-23-2009 03:16 PM
Vicon Plugin Micheal Plug-in development 2 08-29-2007 04:03 AM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM


All times are GMT -7. The time now is 12:25 AM.


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