0
$\begingroup$

Can I open GUI window from bpy module and control scene from script?

Example:

import bpy
bpy.context.window_manager.windows["Default"].open()
$\endgroup$
  • $\begingroup$ Max, can you elaborate on what you want to do? Windows in blender have no name, the screen does, ie there is no window_manager.windows["Default"]. Thus it's hard to answer based on your example. The operator bpy.ops.wm.window_duplicate() opens a new duplicate window, bpy.ops.screen.area_dupli() opens a new window of one area. $\endgroup$ – batFINGER May 25 '16 at 2:36
  • $\begingroup$ @batFINGER i just want open Blender window from .py script in Linux and use same bpy in script and in window (blender builded as module already) $\endgroup$ – Maxim Lis May 25 '16 at 8:17
  • $\begingroup$ Suggest changing title of q to "Open GUI window from bpy built as python module". Going by This is mainly limited to features which can be usable in background mode, so you cant for instance do OpenGL preview renders. from wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule my guess is you can't. $\endgroup$ – batFINGER May 25 '16 at 15:06
1
$\begingroup$

Blender built as a python module does not support a gui interface, it's runs as if blender was started in background mode. You can verify this by checking the background value

>>> import bpy
>>> bpy.app.background
True

If you are working on an addon, you can edit the scripts and then disable/enable the addon to re-load the changes in blender. You may also want to look at the notes on remote debugging using eclipse.

You can open a text file in blender and run it as a script, you can reload the file after changes and then run it again. You may find the addon I link to in this answer helpful, the other answer there shows how to run a script straight from the file in blenders python console.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.