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.

0
votes
0answers
8 views

Python bone Location/Rotation matching with offest

I want to copy modifications made on a rigged set of bones over to a second set of bones. The bones have completely different orientations but seemingly work the same (a rotation is a rotation after-...
2
votes
3answers
63 views

Mesh reverts back to the state before the script was run

I created a script (operator) that converts a selection of quads into a diamond pattern. It works fine but when I try to Inset the newly created selection and change any of the options (like ...
0
votes
0answers
10 views

Can I access Blender's internal openGL state from bpy or bgl?

I am interested in building a custom scene exporter and for that it would be nice to be able to access Blender's openGL state directly. I'd like to, for instance, be able to access allocated VAOs, ...
1
vote
2answers
101 views

Dividing terrain mesh up into multiple tiles with script - border gap issue

Having found a fantastic Script for dividing up terrain from user batFINGER within this post - blender.stackexchange.com/questions/80460/slice-up-terrain-mesh-into-chunks/133258 ...
0
votes
0answers
10 views

How to get list of vertices edges, which border on 2 or more different types of material / uv in bmesh? (2.79)

I try to find that in the api ,but I couldn't find. I try with the bmesh.ops.dissolve_limit method, but not work fine ,does not save all the borders bordering with ...
1
vote
1answer
26 views

How can make the state of a boolean property relative to the 3d view area?

I need to keep unique boolean properties attached to screen area (view 3d) which may have at the same time different states depending on the context view area, like propertie lock camera to view or ...
2
votes
0answers
43 views

The material shows black artifacts when rendered

This is what it looks in Blender This is what it looks after rendered The atoms still looked fine but the bonds looked grainy even though (I think) I assigned the material to bonds the same way I ...
0
votes
1answer
56 views

Setting mesh's origin in python (2.8)

If I create a cube, the origin is originally at the center of mass. I know how to move the origin to the center of one of its faces using the interface, but how can I do the same thing via Python?
0
votes
0answers
19 views

How to force an update when data changes in the VSE?

I'm trying to figure out how to synchronize VSE strips with NLA strips in realtime using blender. The goal is to be able to control multiple NLA strips with a single VSE strip. I've written a script ...
1
vote
2answers
47 views

Modal Operators: Click Object Event

I'm currently working on a python tool using a modal operator. Now I know to finish the operation I can use: if event.type == 'LEFTMOUSE': return {'FINISHED'} ...
0
votes
1answer
23 views

Converting particle simulation into meshes for Keyshot

I created a particle simulation that emits icospheres with 0 gravity, but affected by a wind force field, with the intent to make it look like it's being blown away by the wind. I'd like to render ...
0
votes
0answers
17 views

How can i duplicate a modifier in Python? [duplicate]

I have read this answer Add the Same Modifier to Multiple Objects at Once? on how to duplicate a modifier. I am, however, interested in duplicating a modifier via Python. I have to objects that are ...
1
vote
1answer
25 views

Bmesh bevel is inverted

This looks cool and all, but it's beveled in the wrong direction. How can I flip the direction it bevels, so it looks more like a rounded cube, rather than a rounded plus-sign? ...
0
votes
1answer
30 views

How to update values based on existing properties via Python?

I've written a script takes the start and end values of a VSE strip, and copies those values to the NLA strip of a selected object (effectively syncing the NLA strip with the VSE strip). The script ...
0
votes
2answers
26 views

Adding a random offset to drivers

So I want to animate multiple "cables" (witch are curves), i want to animate the bevel start (or end) and add a random offset to this value. I could put some keyframes and offset them manually but i ...
0
votes
1answer
77 views

Text input field panel add-on blender 2.8

I am integrating a database in Blender. For this, I want to use text input fields. But at the moment I can't edit these fields. And I can't figure out whats wrong with it. The code used for this is: ...
1
vote
1answer
48 views

For Blender, which is the better language to learn - OpenGl or OSL? And why?

I have only yesterday started to learn OSL. Since OSL tutorials are scarce in Youtube, I am beginning to wonder if OSL is becoming obsolete as I get the impression that it is overshadowed by OpenGl. I ...
0
votes
1answer
30 views

Convert files from console using Blender

I'm trying to import glTF file into Blender and export it as dxf by running a Python script from command line. I'm able to do this via GUI when I activate both glTF & dxf plugins. I've seen a ...
1
vote
1answer
66 views

Problem to create background in language other than English in the settings

This is a script part that creates a background, i i run that in Blender with language default (English) run ok , but if i change for example in Spanish line 3 give error KeyError: ...
0
votes
1answer
27 views

How to make local objects link mantain their hierachy in Blender 2.8 python?

Is there a way to maintain hierarchy objects after we Make Local several linked objects the scene ? I notice that if we try Make Local the parent object, the child will be put outside the parent, in ...
0
votes
0answers
25 views

How to create ui button in panel

How to create ui button in panel like this
0
votes
1answer
22 views

With python align text to camera

I want to add a text to an object, soft of like a label. The thing is, when I do it with python, view_align=True doesn't work. The text keeps it's original orientation. I'm not writing a plugin or ...
0
votes
0answers
10 views

How to retrieve contact forces from impulse in Blender?

I am working on retrieving contact forces during a simulation in Blender, I wonder to know is it possible to retrieve contact forces from collision impulses calculated by Blender and if yes, I wonder ...
0
votes
0answers
13 views

how to access Speed Control `speed_factor` when *Stretch to input strip length* is set?

i have a Image-Sequence in the VSE. then applied an Speed Control effect on top. if i use the pythonconsole to check the value of the effect strip that is called <...
0
votes
1answer
36 views

Getting blender camera fov or focal length from the unity3d camera fov

I'm trying to match the fov of blender camera with unity 3d camera fov. Basically i want to calculate blender's camera FOV or focal length, given the fov of unity3d camera. Please help.
0
votes
2answers
47 views

How can I export and import ID property as json? (to make preset file)

I think it should be simple, but could not find correct way ore related document then hope to know way. Now I have active armature as "amt" , and it have many ID properties for shape keys and drive ...
0
votes
1answer
26 views

How to display VSE image-strip filename as overlay?

Is it possible to show the Filename of the current frame of a Image-Strip in the VSE as overlay text?
2
votes
0answers
28 views

How to get coordinates of special vertices in an animated mesh with Python?

I try to get the positions of special vertices while animating. I only found quastions about positions of special vertices in one frame or positions of all vertices in an animation. But I need the ...
0
votes
0answers
42 views

Problems creating a mirror transform operator

I am fairly new to Blender Python. I am trying to code a mirror transform that leaves the selected objects mirrored with its scale applied and its normals facing outside after the mirror transform ...
0
votes
0answers
25 views

Rotoscope Animation to 3D

here's what I wanted to do: I'm manually rotoscoping a 4 seconds animation. I'm only tracing black lines over transparent background (png format) I had a script in processing that read images and ...
0
votes
1answer
53 views

How to display and use operator properties in a custom UI panel?

For example, as you can see in the keymap preferences, there are operators that have properties, like this Smooth Vertices: With this little code ...
0
votes
2answers
25 views

How can I access (read/write) a mesh object's index vi Python?

I would like to retrieve from python the index of an object -- the same index that you get when using an Object info node in shader nodes. I have a reference to ...
1
vote
1answer
48 views

How to customize a material without duplicating it?

I know how to share a material among different objects, customizing it by using the ObjectInfo node. I want do something similar but replacing the ...
0
votes
1answer
30 views

What context does save_as need?

I'm trying to save a texture using save_as, because I want to use the optional Copy parameter. I'm using this code: ...
0
votes
1answer
21 views

Installing pip for Blender and GDAL

I'm trying to configure gdal within blender using the information here: https://github.com/domlysz/BlenderGIS/wiki/How-to-install-GDAL. I already have blender totally configured and the correct gdal ....
0
votes
0answers
31 views

Blender trows an error like this RuntimeError: register_class(…):, missing bl_rna attribute from 'type' instance (may not be registered)

I dont know why this script is not working. Pls help. Below is the full code. Thx # Blender AddOn NoSlide (c) 2015 grgr # # This Addon integrates into the NLA-editor. # Its purpose is to prevent e.g....
0
votes
0answers
12 views

GPU and Multi-CPU computations in Python in Blender 2.8+ with Cycles

Greetings beautiful Blender community, Is there a way to force certain sets of computations to occur on certain devices? For example code to parallelize, consider: ...
2
votes
1answer
39 views

Different behaviour in script compared to Python Console

I'm running a script in Blender 2.79b to save 2D proyections of a 3D face model with annotated facial landmarks, I apply random transformations to the mesh and the landmarks, render the mesh and save ...
0
votes
0answers
19 views

bmesh.ops.dissolve_limit trouble about “delimit” option with set in 2.79

I checked the api for this but I have to say that what I'm looking for is poorly documented: Limited dissolve have 5 options with multiple selection blender 2.79 : Normal, Material,Seam, Sharp, UVs in ...
0
votes
0answers
18 views

How to get and convert Blender 3d viewport to curve data [duplicate]

Searched a lot in python api of bgl and gpu modules. Is there a way to get curves (lines) separated by types of shading from camera projection of 3d Viewport gpengl? For example on image bleow ...
3
votes
1answer
72 views

Blender 2.8 can no longer import module from Textblock

just downloaded todays Blender 2.8 build and it seems I can no longer import a function from another Textblock. Works well on a build from April 5th (haven't updated since then). This simple example ...
1
vote
0answers
18 views

How to get UV stretching (angle or area colors) with Python without looking at viewport?

I know how to view the UV stretching by angle or area in the viewport. However, I want to write a script by which I can determine if a UV island results in a red, yellow or green stretch to correct it ...
0
votes
0answers
15 views

bmesh.ops.dissolve_limit not work fine?

I tried to emulate "limited dissolve" with bmesh, but it behaves differently from the various parameters in blender 2.79, delimit mode (in 2.79 with integer value and in 2.8 with string) Result by "...
0
votes
0answers
10 views

How to rotate a bone with serial input using python

How do i rotate a bone having a serial input. I figured out how to do it with an object but i want to rotate a single bone in an armature. thanks for the help in advance.
0
votes
1answer
48 views

How use Integer / string in EnumPropery items

I have EnumProperty, and i need an integer number when i select my "Mode" Now i have: item = ( ('Mode 1', "Mode 1", ""), ('Mode 2', "Mode 2","")) but i ...
0
votes
0answers
22 views

Normal values not changing while chang normal in bmesh obje

I am using blender 2,79 and blender API to edit my mesh. Following is the my code.. ...
0
votes
1answer
33 views

How can a I read and update the keyframe value of a material node in Blender 2.8 via Python?

This question/answer (Control Cycles material nodes and material properties in Python) has been very useful, so I know now how to enter a keyframe for a given material node using ...
1
vote
1answer
52 views

How to get absolute file path for linked texture image?

I am writing a custom export script for blender and need to copy the textures from the materials texture slots to another location. I am using shutil for copyfile: ...
0
votes
1answer
21 views

what other option in python keymap line for 'PRESS'?

I'm noob in this thing so I don't exactly know how to ask this. so there is this line in a phyton script that responsible for setting key combination that will trigger the 'script', in this case is ...
1
vote
1answer
17 views

Deleting temporary mesh after extracting data

When extracting data via temporary mesh, like this: mesh = object.to_mesh(bpy.context.scene, apply_modifiers=True, settings='RENDER') Do I need to delete this ...