Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
29 views

Changing properties to effect all objects in scene

How do you change the value of all properties among objects that share the same property? Warning this code does not work, just an idea. Example: ...
1
vote
0answers
18 views

Blender & a foot pedal

I have some redundant keys on my keyboard now. I'd like to map them to some keys that Blender does not have any default bindings for. There are 900 such keys in the Linux kernel that I could choose ...
1
vote
1answer
26 views

Script works inconsistently

I'm importing 300-400 images via Images as planes add-on, stacking them at world origin and below each other (0.001 offset). Render engine is Blender Internal. Then I want to disable interpolation for ...
0
votes
1answer
38 views

Create a Python program that creates a new Blender file and edits the scene

Like the title says, I want to create a Python (or Node.js program, although I think Python would be a lot better for this) that creates a new Blender file and is able to change the colour of the ...
0
votes
0answers
29 views

Adding and changing components in nodes for different Shader Nodes in Blender 2.79b

I am trying to add texture and color to a node using python script. So far I am successful in doing that using the following script for texture -- ...
0
votes
0answers
18 views

Join two imported objects to set shape key via bpy script from cmdline

For an automated workflow (call from cmd), I am trying to import two objects into blender and would like to generate linearly interpolated shape keys based on the ...
1
vote
0answers
28 views

How can I make my door open separately?

i followed a very good tutorial, and I managed to create this door completely functional, the mechanics as you can see opens the doors by pressing space bar, I would like to keep this, and I would ...
1
vote
1answer
62 views

How do I access a custom transform orientation by name in Blender 2.8?

bpy.data.scenes['NameOfScene'].orientations['NameOfSelectedOrientation'].matrix.to_euler() Can't figure out new structure of file. Need to convert tiny add-on to ...
0
votes
1answer
30 views

Replace Every instances of an object by a 2.79duppligroup / 2.8CollectionInstance?doing this trough python?

hello i want to replace every instances of my asset with a 2.79duppligroup / 2.8CollectionInstance, with the same roientation and scale but i found no way to do this !? ctrl L dont work, = am i ...
2
votes
2answers
47 views

Continuous and coherent texture mapping on deforming objects

I am new to Blender, and I am stuck with a problem in texture mapping. I have got a series of model files (*.obj) that represents a non-rigid, deforming object. Each of the model file, represents an ...
0
votes
1answer
68 views

Ungrouping a node group with Python

What is the correct way to ungroup a node group from a script? Essentially, I have a material that contains both nodes and node groups. I would like to expand all node groups in that material, ...
0
votes
1answer
61 views

What is the fastest way to create 28 x 28 x 28 individual cubes with its own material in python? Writing 3 forloops is too slow

Is it possible to create this many cubes without for loops? Is it possible to create and place cubes in the right location with a 3D numpy matrix?
1
vote
1answer
24 views

Insert keyframe for active material slot with python

I am trying to create an animation with python. For this I want to keyframe the material slot. So I tried: ...
4
votes
1answer
56 views

How to make use of custom external Python modules in Blender or an add-on on Linux [duplicate]

The path for the Python executable used in Blender (up to 2.79) is not configurable. I looked around and did not find a consistent way to be able to use custom 3rd party Python modules without ...
1
vote
1answer
57 views

Blender 2.8 - Get Environment Texture Path from UI to python script

i'm unable to get inside a python script the path of th Environment texture that i assign in World->Color from the Blender UI. I want to set the .hdr there and than get from there the path (C:/.../...
0
votes
1answer
26 views

Joining all meshes in any context gets error

When I run this code: ...
1
vote
0answers
27 views

How can I modify multiple properties of an Operator in a Panel? [duplicate]

I have an operator that has properties like below ...
0
votes
0answers
16 views

How to get collided objects? (Python)

I want to know what objects are collided. Is it possible to do with existing Blender’s Python API?
0
votes
1answer
67 views

How to Add driver to modifier SimpleDeform-angle by scipt python in blender 2.8

I create script , that script add object, now i create, a modifier , and i want to simulate “Swinging” but i can not understand how it can be done,does anyone know how I can do? : ...
0
votes
0answers
30 views

Blender 2.8 | How to cancel animation scrubbing

I'm using a handler (frame_change_pre) and trying to force Blender to stay on one frame while scrubbing by using scene.frame_set(frameNumber) However, while the ...
8
votes
2answers
941 views

How do I get the Color value from an RGB node with Python?

I'm a seasoned programmer, but fairly new to blender and 3D-modeling in general. So to get an understanding of different properties I want to write python scripts to create multiple renderings with ...
1
vote
1answer
90 views

How do I make a pop up dialog that goes away when pressed “ok”?

I made the code below. It does exactly what I want except that the pop up dialog does not go away after pressing "ok" button on the pop up. Basically I want a pop up dialog where the user enters a ...
0
votes
1answer
94 views

Whats the Blender 2.8 command for adding an object to a collection using python?

I currently have a method that does: self.myCol = bpy.data.collections.new(self.collection_name) bpy.context.scene.collection.children.link(myCol) This method ...
0
votes
2answers
40 views

copy objects from one scene to another

I opened a blend, and I created 2 scenes. in the 1st I have a box and in the 2nd. I have a door. save my file and then use the command duplicate window of the information bar in the window tab. in ...
0
votes
0answers
25 views

How do I repeat my script/macro across all selected objects?

I am trying to create an automated LOD process within Blender, that takes a mesh, creates a group using the mesh's name, renames the mesh to '_LOD0', adds a Decimation modifier and then creates 3 more ...
1
vote
1answer
69 views

setting and getting bone transformations

I am having some problems with blender bones. In short this is my issue: In python I am creating some bones. I transform them in edit mode using a specific matrix. Now I need to read back the ...
0
votes
1answer
17 views

Need help moving a set of cubes from one end to the other on x-axis with python scripting

I am currently using blender 2.8 and I am trying to make a scripted animation where I move a set of cubes from one end to the other on the x-axis with delays in between animations. This isn't really ...
0
votes
0answers
7 views

Export Live Vertex Position to Find Pixel Value

I am very new to Blender, and I am trying to find a way to click on a vertex (or preferably pixel of the texture file) of an obj, and export the coordinate position of that point into some code which ...
0
votes
1answer
44 views

How do I import an image as a plane after opening a new .blend file?

In my script, I'm trying to open a new .blend file, then create a new plane and attach an image to that. I can run the script to create a plane mesh and successfully attach an image to that, but if I ...
0
votes
0answers
30 views

displaying model in opengl

I am trying to depict the story of the thirsty crow using crow, pebbles and waterpitcher with different water levels in it. I have created a objects using blender. When i export these models and use ...
1
vote
1answer
38 views

Change active View Layer with Python

I'm currently trying to figure out how i can change the active view layer with python. The change to 2.8 made sourcing for documentation quite difficult. I'd be thankfull for any help!
0
votes
0answers
24 views

update function in build in blender property

When I create a new property, I can add an update function to execute every time it will be changed: ...
2
votes
0answers
46 views

How to make abs() give correct result for negative numbers?

I am trying to use the simple absolute function abs() in Expression frame for a driver, but it won't work. I've tried to put it in long sentences, or even just typing abs(-1) but the negative still ...
0
votes
1answer
18 views

How can i remove verts in specific Group in VertexGroups via python?

i use Blender v2.76 and i try to remove vertices in specific Vertex Group via python ? my specific group is atm "Test123" (only example), i try now via python to remove the selected vertices from the ...
1
vote
1answer
109 views

Converting string int-tuple to float-tuple

Is this a valid way to convert a string int tuple to a string float tuple, or is there a better way? ...
0
votes
0answers
20 views

Find 3d point in space

In lots of 3d modeling packages it is selection radius functionality. It means you can select nearest point of the geometry without intersection. In my 3d package I have mouse ray and origin ...
0
votes
3answers
51 views

how to print the centroid/origin of an object?

I am trying to re-center an object that I have imported into blender. I have set the object origin to the Center of Mass of the object, now I want to translate the object so its' center of mass is ...
0
votes
2answers
32 views

Problem executing string

In 2.79 I was using exec() with a string to run operators, however in 2.8 copying from the info panel into exec() gives an error with the constraint_matrix: ...
0
votes
0answers
15 views

How do I add a “Cycles” f-curve modifier to an animated property with Python?

I made a script, that by a button click, adds a new modifier to many objects, and here everything works. Then I made 5 keyframes, which I want to loop with an f-curve modifier ('CYCLES'), but I cannot ...
0
votes
1answer
29 views

Which bpy.data.objects option controls the color of the object's texture?

I have 784 cubes in my scene right now, and I can loop through all 784 of them by using for i in range(784): bpy.data.objects[i] Each cube represents a ...
0
votes
1answer
101 views

Gizmo types in blender 2.8

So, in Blender 2.8 avialable Gizmo Widgets(bpy.types.Gizmo, bpy.types.GizmoGroup). i am tring to find out how to use different type of widgets(gizmos) but cant find any information about them. Here ...
0
votes
2answers
66 views

If each cube here represents a pixel, what is the fastest way to change its color so it looks exactly like the 2d image?

Hi people, my goal here is to read the 2D images pixel intensity and transfer those values to the corresponding cubes I made in Blender. The image is 28px by 28px. My first question is if I already ...
1
vote
1answer
108 views

Python: Change the texture resolution limit individually ? Per Material?

in simplify (propreties) we have the option to reduce every textures size that are higher that 2k, for example, to this same resolution. Is it possible to simplify individually an image texture? or ...
0
votes
0answers
23 views

Python batch/script to convert x3d format to obj format

In a Blender context, do you have any idea on how to convert x3d format to obj format using python batch/script?
1
vote
1answer
29 views

How to add buttons from “Overlay” section in custom panel?

I'm trying to add "Normals" section in custom panel ...
0
votes
2answers
37 views

How do I move an object using a csv file?

I am very new to blender and I am trying to move a cube in an environment. I have a csv file with a list of coordinates designated by columns, each column is the X, Y, or Z coordinates with n rows. ...
0
votes
0answers
25 views

Transform Cache python question

I am not much of a scripter, so sorry if this is a simple question... But I would like to create a script that automatically imports and links an alembic file cache to an existing set of meshes in my ...
0
votes
1answer
25 views

Unparent Bone and current bone keep transform

How do I unparent bone from its parent bone but keep unparanted bone and its child bones transform and rotation? If I unparent bone, unparanted bone and its children change their position and ...
1
vote
0answers
22 views

how to correctly update a mesh while animating series of VTP files?

I am trying to render a series of *.vtp files (output of a cfd simulation) in Blender (v2.79). I have successfully installed <...