Next Generation Digital Entertainment Creation Software
Create the future with Autodesk 3ds Max 2011 and Autodesk Maya 2011 software.
  • 1/3
You are here:Forum Home / Autodesk® MotionBuilder® / Open Reality / Executing a Python Script from a device thread
  RSS 2.0 ATOM  

Executing a Python Script from a device thread
Rate this thread
 
39559
 
Permlink of this thread   Subscribe to this thread
avatar
  • Mojonez
  • Posted: 08 February 2010 06:53 PM
  • Location: Corvallis, OR
  • Total Posts: 4
  • Joined: 2009-09-11 23:12:25

Hi folks,

I’m trying to execute a script when a user presses a button in my device thread.  I’m currently using:

Application.ExecuteScript(szScriptFilename)

According to the docs this routine must be executed from the UI thread.  I’ve tested this out and found it to be true - running it from my DeviceIONotify(..) thread causes mobu to hang.  To get around this I simply set a flag in the device thread telling my UI thread to execute the script, then execute the script in my UI thread.

The problem is when my device’s UI panel is not visible - in this case neither of my UI event idle handlers are called:

mSystem.OnUIIdle.Add(this,(FBCallback) &DeviceLayout2::EventUIIdle)
OnIdle
.Add( this,(FBCallback)&DeviceLayout2::EventUIIdle)

I can’t seem to find any way to raise an event within my UI from my device.

Kinda stumped here - Does ayone have any ideas how I can work around this limitation?

I dont think I can expect my user’s to have my device’s UI panel open at all times.

thanks



Replies: 1
/userdata/avatar/xasrack38_mogan.jpg

Hi all -

ADN support helped me out here. 

The solution was to add the OnUIIdle event handler to the device itself.  +1 to ADN support! ;-).

Author: Mojonez

Replied: 09 February 2010 03:01 PM  




   
  Settings Choose Theme color: