Hot answers tagged

13 votes
Accepted

How to delete greyed out Bookmarks and Recents?

You can delete greyed out Bookmarks but not Recent. Recent will just go away after a while or you could delete all of them by clicking X button next to the list. To clear bookmarks list click on ...
user avatar
  • 17.1k
11 votes
Accepted

How to create a button on the n-panel?

I suggest start here: How to create a custom UI? To extend the Properties Area of the 3D View you can either register a custom panel to add UI elements onto or you can append elements to existing ...
user avatar
  • 10.8k
10 votes
Accepted

How do I get the Info window's log text with Python?

Reports to text block operator bpy.ops.ui.reports_to_textblock() . The operator bpy.ops.ui.reports_to_textblock() lists ...
user avatar
  • 77.7k
10 votes
Accepted

When declaring a panel, what does the 'bl_context' value need to be?

In you specific case, the bl_context you are looking for is sculpt_mode. There are many others including: ...
user avatar
  • 2,560
10 votes

Wrap text within a panel

Another solution is to use python's textwrap module: ...
user avatar
  • 965
8 votes
Accepted

show_bones as a Boolean property on custom panel

The python tooltip is really misleading. The bpy.types.View3DOverlay object is actually a member of bpy.types.SpaceView3D. Also the bpy.types.UILayout.prop method only support direct attribute access, ...
user avatar
  • 25.2k
7 votes
Accepted

Wrap text within a panel

I know I'am answering my own question, because I knew how to do it only after posting the question, so for anyone who may need this answer here it goes. I used a wrap function that I made my self, ...
user avatar
7 votes
Accepted

Poll method for custom panel

@classmethod def poll(cls, context): return len(context.selected_objects) == 2
user avatar
  • 77.7k
7 votes

Internal "get/set" function of property?

It's named "testprop" not "test_float" When a property defined via bpy.types.Scene.test_float = bpy.props.FloatProperty(...) is assigned a value ...
user avatar
  • 77.7k
7 votes
Accepted

How to display the "animate property" diamond keyframe insert button (2.8x)

UILayout.use_property_split and UILayout.use_property_decorate Setting ...
user avatar
  • 77.7k
7 votes
Accepted

Blender Python Addon doesn't unregister (registers fine)

Your main problem is your bl_info structure. You can read about it in the Blender official wiki Here's a corrected version: ...
user avatar
  • 29.4k
6 votes

When declaring a panel, what does the 'bl_context' value need to be?

As this is not well documented you could query all existing panel properties like this: ...
user avatar
  • 161
6 votes
Accepted

How to add a checkbox to a panel header?

Add draw_header(context) function to your Panel class and supply any bool property. ...
user avatar
  • 10.8k
6 votes

Display preset RGB values in a panel (and call function when clicked)

Have a look into How do i create Palette UI object and How to get a specific color/slot from a Color Palette Quickly combined the code of both answers to display 50 random generated colors and their ...
user avatar
  • 1,865
5 votes
Accepted

Is there a way to display a multi-lines message in panel / popup?

Example using an UIList based on the answer of Create an interface which is similar to the material list box? and my modification for Displaying text inside an addon Panel to get some kind of log ...
user avatar
  • 10.8k
5 votes

How to make custom "create options" panel in bottom left

This does what I wanted. There are 5 things needed to make it work: Your operator needs bl_options = {'REGISTER', 'UNDO'}, without this the operator properties UI ...
user avatar
5 votes

How to make custom "create options" panel in bottom left

While mountainstorm's answer is functional, you actually don't need so much to get the redo UI to show up. (At least not in Blender 2.9 - I haven't tried this in earlier versions but the release notes ...
user avatar
5 votes
Accepted

How to control spacing/alignment of Label + Horizontal Enum Property?

Just set layout.use_property_split property in your draw method to True: ...
user avatar
  • 10.8k
5 votes

how to ad a panel in the properties/data Speaker specific

Add a poll method. To narrow it down could look to see if context object is of type 'SPEAKER' or since it is in the properties space, there is a speaker context ...
user avatar
  • 77.7k
5 votes

show_bones as a Boolean property on custom panel

If your panel is located in 3d View, you can access all overlay properties via Context.space_data. https://docs.blender.org/api/...
user avatar
  • 1,865
5 votes
Accepted

How to display a fixed list of RGB values in a panel and when a color is clicked call an operator

As has been mentioned elsewhere, template_palette is implemented in C as uiTemplatePalette and that function does not take any ...
user avatar
  • 29.4k
5 votes
Accepted

Update Float Property Based on Selected Object

Use Application Handlers (bpy.app.handlers) ...
user avatar
  • 2,122
4 votes

How do I get the Info window's log text with Python?

As of Blender version 2.81, bpy.ops.ui.reports_to_textblock was removed, (see D5510) because the functionality to read Info was already available through the ...
user avatar
  • 29.4k
4 votes

How to reference a particular Panel used in the ui?

You can get the panel in a single operation but not by label, since panels labels aren't necessarily unique, you should use the panel name. eg: ...
user avatar
  • 44.4k
4 votes

How to nest sub panels and submenus on the TOOLS panel (T)?

You can declare as many menus as you like and concatenate them by calling each menu within the previous menu by layout.menu(menu_identifier). You can even ...
user avatar
  • 10.8k
4 votes
Accepted

How to populate UIList with all material slot in scene? 2.8

Scene.material_slots If I understand question you want to display all the materials used by all the objects in the scene. Every ...
user avatar
  • 77.7k
4 votes
Accepted

Warning: 'CLASS_NAME' doesn't have upper case alpha-numeric prefix

The part before _PT_ must be uppercase alphanumeric to suppress the message (no special characters). You can use whatever for the part after it though, ...
user avatar
  • 25.2k
4 votes
Accepted

Disable button when another button has been enabled

Assign any bool to UILayout.enabled (layout element): https://docs.blender.org/api/current/bpy.types.UILayout.html?highlight=...
user avatar
  • 1,865
4 votes
Accepted

Display object custom value in the object panel

Change bpy.types.Scene to bpy.types.Object in register and unregister. where you use “scene.” Use “active_object.” instead. or whatever actual object you want. Adding a property to a type means ...
user avatar
  • 606
4 votes
Accepted

Is it possible to use single pointer to assign on multiple modifers' Pointer Properties at once?

Sync Data: ...
user avatar
  • 2,122

Only top scored, non community-wiki answers of a minimum length are eligible