0

How do I write a script that would goto my custom workspace and initiate the mode set.

I want it so when I swipe to Modelling in my pie menu it chooses my "Modelling" workspace and goes to object mode, not edit mode.

I have pie menus installed, will I write it in script from then run it from pie.

here are some of the code snippets I've managed to collect.

wm.context_set_id Context Attribute: window.workspace Value: Modeling object.mode_set

wm.context_set_id Context Attribute: window.workspace Value: Sculpting sculpt.mode_set

Marc Volkers
  • 279
  • 2
  • 8

1 Answers1

0

bpy.context.window_manager.windows[0].workspace = bpy.data.workspaces['Modeling'] bpy.ops.object.mode_set(mode='OBJECT')

Marc Volkers
  • 279
  • 2
  • 8
  • it appears you can't stop it from always going into edit mode, why blender, WHY! – Marc Volkers Jul 30 '21 at 14:25
  • well, the whole point of having a modeling workspace is to model, ie, edit, so that's why. You can delete it and add your own workspace that you call it Modeling. If you derive that workspace from Layout it can be set up any way you want. – Marty Fouts Jul 30 '21 at 14:59
  • It's cool, I just model and sculpt with-in the workspace now, don't need to worry about what I was trying to do above. Was cool that workspaces change the desired tabs and buttons to ones preference. meh! – Marc Volkers Aug 11 '21 at 13:24