Skip to main content

Questions tagged [python]

Python is an object-oriented programming language. In Blender, it is used as a general purpose scripting language and to create add-ons to extend Blender's functionality.

4,064 questions with no upvoted or accepted answers
5 votes
0 answers
2k views

Addon not correctly reloading

Disabling my addon gives this error: RuntimeError: unregister_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered) and re-enabling it gives this error: ValueError: ...
Way2Close's user avatar
  • 480
5 votes
0 answers
154 views

Blender Python: Output Paragraph of Text?

Is there any built-in support for automatic line breaks when writing text to the UI, such as through the layout.label() function? For example, if I set text that ...
Robert's user avatar
  • 1,325
5 votes
0 answers
652 views

PyOpenGL and VBO Indexes

Long story short, I'm trying to do a modal handler that draws using OpenGL into the viewport. Immediate mode through BGL works fine, but is dog slow. I tried using VBOs through BGL but there seems to ...
Kiki W.'s user avatar
  • 606
5 votes
0 answers
1k views

How to triangulate a polygon using Python?

I often meet the following problem: mapping a point on the surface of a polygon in 3D coordinates to the corresponding polygon in a UV map. To do that, the only way I've found is to: Triangulate the ...
lemon's user avatar
  • 60.5k
5 votes
1 answer
342 views

"Search for unknown operator" On Start-Up After Removing Module and Shortcuts

For lack of a less drastic alternative, I created a whole module just for setting bpy.context.window.screen to a specific screen, since ...
Blitzen's user avatar
  • 182
5 votes
0 answers
249 views

How can I derive from an existing Operator in Python?

When creating a new Blender Operator, you'll derive the class from bpy.types.Operator, like this: ...
aliasguru's user avatar
  • 11.2k
5 votes
1 answer
298 views

Cannot mix .user and .addon keyconfigs in register()

I've been messing around with keymaps lately and I've come across behavior that doesn't make much sense to me. I am searching the current keyconfig for a specific keymap item, removing it, then adding ...
Italic_'s user avatar
  • 1,553
5 votes
1 answer
625 views

Is possible to generate a preview material from python?

I would like to generate the preview of a list of materials. I could create a sphere and apply the material, render and save it in a loop, but what I would like is to use the internal functionality of ...
Antonioya's user avatar
  • 492
5 votes
0 answers
710 views

Adding sliders from UI to pie menu

I've seen some sliders working in pie menus but the one I'm trying to add to my pie script isn't showing up. Its the 'autosmooth normals' slider from the Object Data tab, under Normals (in the ...
fjg3d's user avatar
  • 113
5 votes
0 answers
833 views

Converting an obj sequence to a .bobj fluid sim cache?

I'm wondering if there is any way to accomplish turning an obj sequence exported from realflow into a .bobj fluid cache that I could then trick blender into loading as a native fluid sim cache. So far ...
BenSimonds's user avatar
4 votes
0 answers
218 views

Migrating geometry shaders to Metal

I'm working on BlenderBIM (architecture addon for Blender) and we have a bunch of shaders to support plan annotations in viewports. Mainly it's simple shapes based of lines - lines, segment based ...
FamousSnake's user avatar
4 votes
0 answers
377 views

Drawing non-polyline smoothed lines with `gpu` module

Backstory: Since bgl module will soon to be deprecated and it's doesn't work on Metal already I was trying to move code to gpu ...
FamousSnake's user avatar
4 votes
0 answers
57 views

Python access Bevel Custom Profile handles

We can access the profile points via obj.modifiers["Bevel"].custom_profile.points[1].location But how to get the handles location at that point?
X Y's user avatar
  • 6,213
4 votes
0 answers
132 views

Detect when an Asset has been applied (dropped in the viewport)

So far this has been the way I check if World asset has been dropped in the viewport: ...
karlisup's user avatar
4 votes
0 answers
173 views

How to build an autocomplete search to search for some words in memory?

I am using a StringProperty to assign a list of (Singles) words through manual entry, and I was wondering if you could build some sort of autocompletion for a StringProperty. Suppose I have a list of ...
Noob Cat's user avatar
  • 1,269

15 30 50 per page