2
$\begingroup$

As far as I know this was not possible on 2.7x, but with the new interface in 2.8, are we finally able to create new tabs (like the World or Materials tab) in the Properties window? Otherwise, is there a good reason to prevent users from doing this? There are some cases where it would make a ton of sense to create separate tabs entirely (render farm managers, game engines like armory that have lots of settings making the existing panels look too crowded)

$\endgroup$
  • $\begingroup$ This would result into very messy UI for me. Personally, if I need to make some parts of UI quickly accessible, I just divide the panel into more instances and hide the header, resize... so only the area I need is visible (like Bake button + settings). Or you can put the same type of window beside or on the second monitor. Can you create an image what is your idea specifically? $\endgroup$ – Jan Kadeřábek Feb 3 at 10:18
  • $\begingroup$ Basically it would be the ability to create tabs by means of add-ons. I would not expect every developer to create one, and you can always opt out specific tabs by disabling that particular add-on. It's just that for some big projects that have grown to have a high number of settings it would make sense for them to stand on their own. I'm thinking about Armory game engine in particular, for links between object and logic it makes sense to use the panel, but the engine settings would be better on a separate tab with its own icon. It would also look more solid and professional in my opinion $\endgroup$ – DiegoBM Feb 3 at 11:04
2
$\begingroup$

SpaceProperties.context

This is the enum property that used to go across the top of properties area, rendered as tabs.

class bpy.types.SpaceProperties(Space)

Properties space data

context

        TOOL Tool, Active Tool and Workspace settings.
        SCENE Scene, Scene.
        RENDER Render, Render.
        OUTPUT Output, Output.
        VIEW_LAYER View Layer, View Layer.
        WORLD World, World.
        OBJECT Object, Object.
        CONSTRAINT Constraints, Object Constraints.
        MODIFIER Modifiers, Modifiers.
        DATA Data, Object Data.
        BONE Bone, Bone.
        BONE_CONSTRAINT Bone Constraints, Bone Constraints.
        MATERIAL Material, Material.
        TEXTURE Texture, Texture.
        PARTICLES Particles, Particles.
        PHYSICS Physics, Physics.
        SHADERFX Effects, Object visual effects.

In the python console

>>> for a in C.screen.areas:
...     if a.type == 'PROPERTIES':
...         break
...         
>>> s = a.spaces.active
>>> s.context
'DATA'

>>> s.rna_type.properties['context'].enum_items_static.keys()
['TOOL', 'SCENE', 'RENDER',
    'OUTPUT', 'VIEW_LAYER', 'WORLD', 
    'OBJECT', 'CONSTRAINT', 'MODIFIER', 
    'DATA', 'BONE', 'BONE_CONSTRAINT', 
    'MATERIAL', 'TEXTURE', 'PARTICLES',
    'PHYSICS', 'SHADERFX']

Setting the panels bl_context class property to a value above defines which "tab" it is in.

Trying to set an enum to an undefined value will throw an error, as opposed to setting bl_category in a 'TOOLS' panel which creates a new tab.

To make a new tab would need to somehow add an item whilst un-re-registering the property. Perhaps this is doable, in the back of my mind there has been a question either here or on the blender artists forum.

The property is inter-twined with context. I wouldn't mess with it.

Alternatives

  • choosing one of the above for your Panel context. Remember there is the ability to subpanel in 2.8 by defining a panels parent panel.
  • appending or prepending draw methods to existing panels. Prepending to a panel that is always at or near the top gives high vis easy access. IMO this is under-utilized.
  • "take out" (unregister) panel classes that you wish to replacce. Eg overtake one of the conexts by unregistering other panels when in "armory" mode.
  • or redraw an existing panel. Panels have a _drawfuncs list that can be manipulated at runtime.
$\endgroup$
  • $\begingroup$ That's invaluable information @batFINGER, thank you $\endgroup$ – DiegoBM Feb 3 at 12:33
  • $\begingroup$ @batFINGER, I find your answer very interesting thanks. I am new with blender2.8, I wonder if you could give a more comprehensive example of a Panel that sits inside, let's say, the 'MATERIAL' tab. That would be greatly appreciated. $\endgroup$ – gmagno Apr 10 at 17:28

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.