View Full Version : Force redraw in Python
rui_mac 10-16-2010, 11:20 PM How can I force the redraw of all views in Python?
Rui Batista
|
|
Scott Ayers
10-17-2010, 12:06 AM
I don't know if this will help Rui.
But I've seen this used before: c4d.DrawViews( c4d.DA_ONLY_ACTIVE_VIEW|c4d.DA_NO_THREAD|c4d.DA_NO_REDUCTION|c4d.DA_STATICBREAK )
I think using just the c4d.DA_STATICBREAK flag by itself redraws the entire scene. I've used that in Coffee to update tags before. But I'm not really sure if it's what you're looking for.
-ScottA
rui_mac
10-17-2010, 09:55 AM
Thank you for your help, Scott.
However, I'm getting an error telling:
RuntimeError: Illegal operation. Invalid cross-thread call.
Maybe it is invalid to refresh the views from inside a Python Generator.
What I need is to make my object (the Python Generator) Camera Dependent. So that it gets refreshed whenever a camera is moved or even if it moves itself.
Rui Batista
donelgreeko
10-17-2010, 10:57 AM
Hi Rui,
in this case, pleas turn off "Optimize Cache" in the Python Generator. Now the generator is not cached anymore. You can now do the caching on your own if needed.
Maybe it is invalid to refresh the views from inside a Python Generator.
Exactly, calling DrawViews(...) and calling several other (gui)/functions are just allowed from the main thread.
Cheers, Sebastian
rui_mac
10-17-2010, 11:08 AM
That works GREAT!!! Thank you :-)
Rui Batista
CGTalk Moderation
10-17-2010, 11:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.