Hot answers tagged

10

Reports to text block operator bpy.ops.ui.reports_to_textblock() . The operator bpy.ops.ui.reports_to_textblock() lists reports from the info area into a text block named "Recent Reports"([.nnn] if run more than once.) Test code. Removes existing recent reports before running operator. #remove other Recent Reports reports = [bpy.data.texts.remove(t, ...


9

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 arrow button next to the list and choose Cleanup.


6

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 panels. 1. Panel Blender comes with a few UI templates (Text Editor > Templates > UI ...) . I'd suggest start with UI Panel Simple ui_panel_simple.py and use it ...


5

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, like this: def wrap(width, text): lines = [] arr = text.split() lengthSum = 0 strSum = "" for var in arr: lengthSum+=len(var) + 1 if ...


4

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: cls = getattr(bpy.types, "VIEW3D_PT_view3d_display") Note that bpy_types.TypeMap is part of Blenders internal logic which you're not meant to touch! :)


4

Add draw_header(context) function to your Panel class and supply any bool property. Following example is based on ui_panel_simple.py template: import bpy class HelloWorldPanel(bpy.types.Panel): """Creates a Panel in the Object properties window""" bl_label = "Hello World Panel" bl_idname = "OBJECT_PT_hello" bl_space_type = 'PROPERTIES' ...


4

UILayout.use_property_split and UILayout.use_property_decorate Setting UILayout.use_property_split in conjunction with UILayout.use_property_decorate to True, marks down the animation button. (Currently not over-documented) My understanding is the split makes room for it, and the decorate draws it. With developer extras on, right click > view source. ...


3

Operator options show up in the Redo Panel after the operator has been executed. If the operator is cancelled instead of confirmed, no options will appear as no operator has been run (even though an operator was started). Your screenshot shows the operator is running, but not yet finished/confirmed.


3

@classmethod def poll(cls, context): return len(context.selected_objects) == 2


3

In you specific case, the bl_context you are looking for is sculpt_mode. There are many others including: objectmode mesh_edit curve_edit surface_edit text_edit armature_edit mball_edit lattice_edit pose_mode imagepaint weightpaint vertexpaint particlemode


3

Drag the signs at the corner of each window in following directions.It will help you close all the windows.


3

Adding to already registered panels As an extra to other answers re defining a draw header on a new panel class, can monkey around with existing panel classes. Here is an example that adds gravity checkbox and "XXX" to audio panel header, and disables that panels layout with scene.use_gravity (silly) import bpy from bl_ui.properties_scene import ...


3

Edit : Make sure you are using a mouse with right-click capability. Right click on the tab and choose Delete If the popup doesn't appear then there is something wrong with your installation or this is a bug. You might try resetting Blender to factory settings or there is a hidden feature I do not know in the preferences to disable it... To reset to ...


3

Mix in class Following on from your answer, can also create a mix in class. An example below. The EeveeBasePanel mix in class will make any panel inheriting it be in properties, render context, default closed and poll when the render engine is eevee. This comes in handy if you are going to register other panels. For example I have put a test panel in ...


2

You can save your current file, including preferences and window layout as startup file by selecting File > Save Startup File or hitting Ctrl + U


2

scene['Object_type'] will refer to a custom property you have added to a scene either by using the Custom Properties panel in the scene properties or by blender automatically creating it as you used scene['Object_type'] = 2 in your script or the python console. The proper way to create a new property for your addon to use is by using bpy.props. In your ...


2

To create a custom panel you subclass bpy.types.Panel and set the space, region and context to suit. Setting the space and region to PROPERTIES and WINDOW will place the panel within the properties. Without a context it will show in every section, object will place it only in the object properties. class testPanel(bpy.types.Panel): bl_label = "Test ...


2

Ok, I've got it. But still do not fully understand. bl_info = { "name": "Collection Menu", "author": "CoDEmanX", "version": (1, 0), "blender": (2, 65, 0), "location": "", "description": "", "warning": "", "wiki_url": "", "category": ""} import bpy coll_data = [ ("Option A", "The first option, can be found by ...


2

you can stack layouts, as each of the container layout elements can host other containers: layout = self.layout box = layout.box() # put a column layout into the box col = box.column(align = True) # also separators work col.separator() # add a row layout into the column, which is inside the box, which is inside a panel,..... ...


2

This is not really about different material panels, but entirely different materials altogether you are editing. Materials always belong to a certain render engine and are mostly incompatible between each other; and can't for the most part be used for other render engines (with the possible exception of Blender Internal and Blender Game Engine). The ...


2

In your image it shows that the operator panel is minimised. Click the arrow next to "Operator" to maximise it and show the options.


2

Just edit the bookmarks.txt inside the Blender's config folder :) For me, in Linux, is under /home/{user}/.config/blender/{version}/config/bookmarks.txt Once deleted, just close and reopen Blender ;)


2

Another solution is to use python's textwrap module: import textwrap textTowrap = "Your text......................................" wrapp = textwrap.TextWrapper(width=50) #50 = maximum length wList = wrapp.wrap(text=textTowrap) #Now in the panel: for text in wList: row = layout.row(align = True) row.alignment = 'EXPAND' row....


2

Have a look in File > User Preferences > Input > Screen Editing > and check how you have the Move Area Edges setup. You need to have this option checked to be able to resize the windows by dragging on the windows edges. Also check to see what the selection method is. Mouse, Left Mouse button.


2

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 automatically draw a button to call your menu without declaring any extra operator by layout.operator("wm.call_menu").name="menu_identifier". Code ripped from How to create a custom UI? and combined with ...


2

While there is a small python script that handles the header and menus for the outliner, most of the outliner drawing is handled in C source files. This means that customising the outliner appearance requires a custom build of blender, though you can add menus as shown here. I would suggest you keep using the panel in the properties editor that you have ...


2

In 2.79 you have these options in the Settings.


2

You can add properties to the scene that can be retrieved by all scripts. In the code you can find different 'variabletypes' (I think you can also make custom properties/variables yourself). To actually retrieve the value you will have to write bpy.data.scenes['Scene'].Annotation.my_bool import bpy from bpy.props import (StringProperty, ...


2

It's named "testprop" not "test_float" When a property defined via bpy.types.Scene.test_float = bpy.props.FloatProperty(...) is assigned a value scene.test_float = value it is stored. "behind the scenes" as a custom property scene["test_float"] ("second time above") In the get / set example ("first time above") it is instead stored in a custom property ...


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