[Bf-extensions-cvs] [bbe0cee0] master: POV: Improve specific pov workspace *fix: too invasive default workspace, now only triggers if pov was saved to default renderer during previous session *add: opening text editor sidebar to better show pov specific tools and text editing nature of the area.

Maurice Raybaud noreply at git.blender.org
Mon Aug 3 23:09:37 CEST 2020


Commit: bbe0cee094a48761118f8efe3f9b84ae3f110a2c
Author: Maurice Raybaud
Date:   Mon Aug 3 23:08:35 2020 +0200
Branches: master
https://developer.blender.org/rBAbbe0cee094a48761118f8efe3f9b84ae3f110a2c

POV: Improve specific pov workspace
*fix: too invasive default workspace, now only triggers if pov was saved to default renderer during previous session
*add: opening text editor sidebar to better show pov specific tools and text editing nature of the area.

===================================================================

M	render_povray/ui.py

===================================================================

diff --git a/render_povray/ui.py b/render_povray/ui.py
index 1daec148..6bdadccf 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -259,13 +259,10 @@ for member in dir(
 del properties_particle
 
 
-
-#Use some delay?
-#https://blenderartists.org/t/restrictdata-object-has-no-attribute-scenes-how-to-avoid-it/579885/4
 ############# POV-Centric WORSPACE #############
 @persistent
 def povCentricWorkspace(dummy):
-    """Set up a POV centric Workspace if addon was left activate from previous session
+    """Set up a POV centric Workspace if addon was activated and saved as default renderer
 
     This would bring a ’_RestrictData’ error because UI needs to be fully loaded before
     workspace changes so registering this function in bpy.app.handlers is needed.
@@ -274,10 +271,9 @@ def povCentricWorkspace(dummy):
     bpy.app.handlers.persistent decorator is used (@persistent) above.
     """
 
-    #bpy.context.scene.render.engine = 'POVRAY_RENDER'
     wsp = bpy.data.workspaces.get('Scripting')
     context = bpy.context
-    if wsp is not None:
+    if wsp is not None and context.scene.render.engine == 'POVRAY_RENDER':
         new_wsp = bpy.ops.workspace.duplicate({'workspace': wsp})
         bpy.data.workspaces['Scripting.001'].name='POV'
         # Already done it would seem, but explicitly make this workspaces the active one
@@ -302,6 +298,7 @@ def povCentricWorkspace(dummy):
                             #bpy.ops.screen.area_move(override, x=(area.x + 5), y=area.y, delta=-100)
 
                             bpy.ops.screen.space_type_set_or_cycle(override, space_type = 'TEXT_EDITOR')
+                            space.show_region_ui = True
                             #bpy.ops.screen.region_scale(override)
                             #bpy.ops.screen.region_scale()
                             break



More information about the Bf-extensions-cvs mailing list