Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 9732

Questions concerning scripting in Blender using the Python programming language. Also use this tag for questions about scripting in OSL (Open Shading Language).

1 vote
1 answer
377 views

How to get operator object from id?

I'm writing a script that contains both an operator and a panel. Both the operator and the panel are created in the script's register() method. In my panel's draw() method, I'd like to be able to ge …
kitfox's user avatar
  • 1,686
1 vote
0 answers
50 views

How to get Panel to use properties from a PropertyGroup? [duplicate]

I'm trying to create a PropertyGroup so that I can share my addon's properties between several different panels and operators. The below is the best I came up with based on the info I could find, but …
kitfox's user avatar
  • 1,686
0 votes
1 answer
449 views

How do I add a new tab to the 3D Viewport? [duplicate]

I'm creating a Panel that sits in the 3D Viewport. Right now when it runs, it is inserted under the Misc tab. I'd like to create my own tab to place it in. How do I do that? class NormalToolPropsPa …
kitfox's user avatar
  • 1,686
0 votes
1 answer
184 views

How to get face normal from a mesh loop?

I'm iterating through the loops of my mesh and would like to get the face it is attached to (so I can get the face's normal). I'm looking specifically for the face normal, not the vertex or loop norm …
kitfox's user avatar
  • 1,686
0 votes
1 answer
1k views

How to set up __init__.py for my addon? [duplicate]

I've written a script and am trying to turn it into an addon. I've been trying to copy an existing addon which is working, but for some reason my variation isn't working. I've created a directory tha …
kitfox's user avatar
  • 1,686
0 votes

How to set up __init__.py for my addon?

Looks like my problem was that in the zip archive I made, I was putting my files in the root. I had to create a subdirectory within my zip with the name of the addon, and then place the source files …
kitfox's user avatar
  • 1,686
0 votes
1 answer
112 views

How to make a Panel accessible while modal operator running?

In my script, I've created an Operator, a PropertiesGroup which holds the properties of my operator and a Panel which lets the user change the properties and start the operator running. My operator us …
kitfox's user avatar
  • 1,686
1 vote
1 answer
339 views

How to have Blender run my script from the filesystem rather than the script window? [duplicate]

I'm trying to figure out a workflow to allow me to develop addons in Blender that doesn't require me to use the Scripting window. … The scripting window is great if your script can be done in a single page, but breaks down when you need to break your code into more than one file. …
kitfox's user avatar
  • 1,686
1 vote
1 answer
832 views

How to have a script run from a keypress? [duplicate]

I'm trying to get keymaps working in my script, but it's not working. I want grid size of the current view3D to double if I press Ctrl-LeftArrow and halve if I press Ctrl-RightArrow. Right now I'm j …
kitfox's user avatar
  • 1,686
1 vote
1 answer
725 views

How to check if a PointerProperty has a value?

I've written a script that contains a bpy.props.PointerProperty which the user can set to an Object. I'm having trouble finding any examples on how to access the contents of this property. How do I …
kitfox's user avatar
  • 1,686
1 vote
1 answer
470 views

How to tag a redraw in all viewports?

I've designed a modal operator that changes the geometry of a mesh when the user clicks and drags the mouse. I'm able to see the geometry update in the viewport I'm dragging in by tagging a redraw wi …
kitfox's user avatar
  • 1,686
3 votes

How to tag a redraw in all viewports?

You can iterate through all areas of the screen and tag them: def modal(self, context, event): for area in context.screen.areas: if area.type == 'VIEW_3D': area.tag_redraw()
kitfox's user avatar
  • 1,686
2 votes
1 answer
395 views

How to set custom icon for WorkSpaceTool?

I'm trying to create my own WorkSpaceTool and give it a custom icon to distinguish it from the other tool icons. I've used bpy.utils.previews before to load icons for panel buttons - however, it does …
kitfox's user avatar
  • 1,686
2 votes
1 answer
227 views

How to remove text written over top of FloatVectorProperty

I'm writing a panel that displays a vector that in meant to indicate the direction of a normal. Using FloatVectorProperty with subtype="DIRECTION" would seem ideal for this, but the result has the pr …
kitfox's user avatar
  • 1,686
1 vote
0 answers
20 views

How to have a keymap work in object mode and edit mode? [duplicate]

I've created an operator that uses a keymap to activate it. While it works in object mode, it is not being called in edit mode. Is there a way to get this to run in edit mode too? import bpy class …
kitfox's user avatar
  • 1,686

15 30 50 per page