Previous Thread  Next Thread

chat icon Change focus from console window to node editor window

wretch1958

Posted: Mon Sep 24, 2012 11:52 pm
Joined: 29 Mar 2012
Posts: 21
If I am in a Python console window, and also have a node editor window open, and I try the command "bpy.ops.node.xxxxnodecommandxxx" for any node editor context sensitive commands, it gives me an incorrect context error because I am in the Python window, not the node editor window. How do I change the window focus from the Python console?
Reply with quote


CoDEmanX

Posted: Tue Sep 25, 2012 12:27 pm
Joined: 05 Apr 2009
Posts: 696
put the bpy.ops call into the simple operator template, change it to be a node operator, remove the test call at the bottom, run script, go to node view and hit spacebar, type the name of your new operator and click/return

you can also override the context, see:
http://www.blender.org/documentation/blender_python_api_2_63_21/bpy.ops.html?highlight=override#overriding-context
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group