Python Forum

Full Version: Embed Python blender code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have got a legacy Python with blender code:

import bpy
import bmesh

....

def debug(is_debug):
    if is_debug:
        bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
        time.sleep(2)

...

bpy.context.scene.objects.active = SG
bpy.ops.object.mode_set(mode='TILE')
... and so on ...

I saw few example of how to embed Python code into a VC++ app, but they are only few simple Python calls:

Py_Initialize();
...
obj = PyRun_String(expr, Py_eval_input, main_dict, NULL); 
...
Py_Finalize();
Is there any chance to use python blender code embedded into a VC++ app, with python window embed into a VC++ window ? Or is impossible ?