Closed Ndot closed 1 month ago
apart from the fixes that happened in a meantime, i think that what you see is correct behaviour. It is blender who decides when to redraw the viewport and we can only ask him nicely to do so https://blender.stackexchange.com/questions/211184/how-to-tag-a-redraw-in-all-viewports
Calling a script from text editor is different than calling it from vs code. I will not debug further.
just found the code, yes what i said is correct, only after execution ends the bledner ui is refreshed
class RunScriptOperator(bpy.types.Operator):
def execute(self, context):
ctx = prepare_script_context(self.filepath)
runpy.run_path(self.filepath, init_globals={"CTX": ctx})
redraw_all()
return {"FINISHED"}
Hi, First of all awesome addon :muscle:
Been having a bit of a problem when running scripts from VScode tho. At first it seemed it was not running functions at will but after looking a bit more in depth I noticed that when adding objects to collections the objects only show after the script ends. But when running from inside blenders text editor everything works as expected. I tried some update functions on collections but to no avail, and it's weird to have different behaviors.
Here's a bit of code that creates a cube, duplicates and moves the duplicated. If you run step by step you'll see the cube only shows after the script ends.
Blender: 2.92.0 Blender Development: 0.0.15
If you have any idea on what causes this or know how to force collections to update please let me know. Thanks