Post #1767: fj

📋 Metadata

🏷️ Tags

popup-dialog ui-customization intermediate solved

  • Popup Dialog Editor
  • Custom Icons
  • Python Scripting
  • Property Editor

💬 Content

fjg3d:

Adding the Snapping Elements to a PME dialog pop up by right-clicking on the icon in the header of a 3Dview (type set as Custom (List)), they will show up as a column of icons. Its nice to do it this way since the buttons will remain highlighted to show which is selected.

This Custom (List) option generates buggy buttons IMO. Using prop function with expand=True works better. Will add this option in the next version:

Eg. instead of Custom (List):

L.props_enum(C.scene.tool_settings, 'snap_elements')

we can expand buttons vertically:

L.column().prop(C.scene.tool_settings, 'snap_elements', expand=True)

or horizontally:

L.row().prop(C.scene.tool_settings, 'snap_elements', expand=True)

fjg3d:

This seems to work for most things in that header area except Transform Orientations (Global, Local, Gimbal, etc). When using right-click to add Orientations, after selecting the button in my dialog pop up, it skips the part where it asks you how you want to use the operator (the ‘select type’ dialog box), leaving scene.type in the PME editor command tab. Custom created orientations (+) seem to have similar problem

Hmm, can’t reproduce. Can you send me a screenshot (or a video) when/where you right-click Orientations button?

fjg3d:

When trying to set up the Orientations as a Command (not using right-click), the button responds as if its a property with a pull down menu with all orientations, instead of a button with a single specific orientation

Try this code instead (Command tab):

C.scene.transform_orientation = 'GLOBAL'

fjg3d:

Also, setting Snapping Elements as ‘Property’ type has different results than when setting Pivot Points to ‘Property’ type. for snapping elements it makes a column list with just icons (actually kinda cool, but maybe not intended?), where as with Pivots its a drop down menu.

Yep, Property tab uses prop function which can generate different widgets depending on the data. Check my examples with expand option above. They can be useful here.


❤️ 1 likes


🔗 View on Blender Artists