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
6 views

Impact Forces in Blender Game Engine

I am using the blender game engine to run drop test physics simulations and I was wondering if there is a way to collect the force and impact data from the collision. Maybe using "appliedImpulse"? I ...
0
votes
1answer
16 views

How to get the length of an mp4 video inside a node?

Work with python in blender 2.8 , i try to find a command for get the lenght of an video inside at image node. ...
0
votes
0answers
31 views

My imported .obj model is appearing as a tiny dot [duplicate]

I wanted to extract some models from ps2 games to blender. I followed this tutorial here: https://www.youtube.com/watch?v=iHlJ3qO4lys and got through all the steps, extracted my model exactly as shown ...
2
votes
0answers
16 views

Non English 3d Text with Python

I am trying to create 3d text object using python. The text has non english letters and the default 3d text font doesn't have these letters. I can use another font file that supports the entire ...
0
votes
0answers
24 views

How can I detect text from a non-text object in Blender? [on hold]

Is it possible to detect text in a non-text object? Say for instance you have a picture of a receipt or something and you have some python code that runs over each possible character and matches it ...
0
votes
1answer
6 views

How to stash all actions to current armature?

I just imported a bunch of actions from different files into one blend, but the GLTF exporter can't locate them without them being in the NLA stash. (There used to be a plugin that would export all ...
0
votes
0answers
25 views

Low level rendering functionality in Blender's API

While all Blender functionality is exposed through operators, their indirect way of acquiring data for a certain task is tedious. Especially when the data we want them to operate on is acquired ...
1
vote
0answers
15 views

Automated rendering actions in modal operator is cancelled

I'm trying to render a bunch of actions with a modal operator that is called with a timer. The first action is rendered as expected, and strangely some times the second and third are rendered aswell, ...
0
votes
0answers
6 views

Check for modifier key when opening a menu

Is there any way to make a different menu appear when a user holds a modifier key when clicking the menu name in a header? I've created a menu that is appended to the 3d view header. I want to have it ...
0
votes
1answer
12 views

PyQt and Tkinter seem to not work with Blender 2.8

When importing PyQt5 blender throws this: ...
0
votes
0answers
11 views

How to proper run a python script and a physics simulation simultaneously?

I'm trying to animate objects via script and simultaneously run a physics simulation, but it's not working correctly. The physics simulation is several frames off: The Setup is quite simple: I ...
0
votes
0answers
11 views

How to implement a simple chat option for server-client based game [migrated]

I want 2 players to be able to chat with eachother. I have a running server-client game, but I'm kind of stuck on this one.
1
vote
1answer
28 views

Can mesh analysis colours be applied to face material colour

The mesh analysis overhang tool gives me a coloured heatmap in edit mode. Is there any way to use these colours and apply them to the face material colours, so they are visible in object mode? perhaps ...
-1
votes
1answer
58 views

Selecting a new material slot to selected vertices

I have a few vertices selected and would like to change the colour of those vertices with Python script. This means adding a new material slot. I have tried this script, however it changes all the ...
1
vote
1answer
22 views

Blender UI button creation

I have made a script which I wanna activate with that M button. I've seen tutorials on how to do the simple buttons but I can't seem to figure it out how to make a button there and how to add an icon ...
1
vote
1answer
16 views

Where are the Shape keys names located? (Scripting)

How can I call up this name (Key.001) in python? Every object has it's own one Key name (Key, Key.001, Key.002, Key.003...) Here it is in the in the console. in order to show it up I had to drag the ...
0
votes
0answers
18 views

Does an assimp based importer already exist?

I'm looking for but for now I haven't found one, I'm thinking of writing one, some good reason not to do it? assimp It already has a python binding even though I'm not sure the status for python3.
1
vote
0answers
52 views

Python Mix Shader Diffuse BSDF Glossy BSDF Nodes

I am trying to create a plane object in python that uses a mix shader with the first shader being a Diffuse BSDF Shader, color black, roughness 0.200 and the second shader being a Glossy BSDF shader, ...
0
votes
0answers
11 views

Custom importer for amature bones

I'm trying to make an Amature/Bone Importer in Python for a custom file format in Blender 2.80. In this file format I have the following data: Bone Name Parent Bone Name (Quaternion) Rotation to ...
0
votes
0answers
15 views

Create custom layout.prop_menu_enum changes listener

I've got something for you: I made a python script with that creates a custom submenu in the TOPBAR_MT_edit blender menu. It's a layout.prop_menu_enum with multiple choices which items come from a ...
-1
votes
0answers
18 views

Render from many cameras with python script

I have six cameras set up in my scene. Is it possible to render from each camera one after the other with a python script and saving the files.
0
votes
0answers
9 views

How to make one value influence another value in the node editor if theres no input socket?

I am currently trying to have a node setup where a value node output is linked to the Mix input of a Glare node. However, there's no input socket for the Mix input, only a number value. Is it possible ...
0
votes
0answers
25 views

how do I import .obj using python/blender api

I am new to blender/python api. I am trying to import an object into blender using python api, and I keep getting syntax errors. Here is what it looks like: ...
1
vote
1answer
31 views

Change color space of image texture node using python?

I have trouble to get a script working within Blender 2.8. What is the correct way to change Color Space mode of an image texture node? ...
0
votes
0answers
9 views

How controll uv map from select face in edit mode with python?

I look an addon , name is Magic UV (v6.0) look fantastic but complex, I would just like the ability to rotate, scale, move the uv map to the selected face, I'd like to do it through 3 different ...
0
votes
0answers
19 views

Run Script Error [closed]

Every time I press the run script button it tells me "python script fail. look at the console for now..." and when I look at the console it comes up with this: ...
6
votes
4answers
500 views

How to create a Tetrix/Sierpinski Tetrahedron fractal radiating from 0,0,0 ? Python or nodes

Mesh. I want to create it not by dissection of edges, but instead by splitting 1 into 4, or should I say, add 3 more to the original location before moving all 4 away from Local 0,0,0 , and then doing ...
0
votes
0answers
15 views

How to share my library by server/cloud?

I have many model , project , material etc. , but i think , how to append that library from cloud/server, Am I ignorant in this area, does anyone know how to put me on the right way ? Like to ...
2
votes
0answers
36 views

Tracing a light ray with paths

I'm trying to simulate optical rays within blender and am not really advanced within coding for blender or using BGE, so I figured I'd come here for help. The setup I'm making involves animated ...
0
votes
0answers
10 views

Rotating collection objects together with python in blender 2.8

I created a character. The character has a body, skeleton and clothes. I want to rotate all of these object together.So far I have been able to select the objects in the collection. Below is what I ...
5
votes
0answers
72 views
+100

Copy scene node tree to other scenes

I have a Blender file wih many scenes and I want to copy the node tree of one of them to the other scenes. From Blender interface it is a very simple task, in python I have tried using bpy.ops.node....
0
votes
0answers
17 views

Delete internals parts of mesh

I have a mesh which has internal parts. These parts can be loose, but can also be part of the mesh. I basically want to delete everything inside the "shell" of my mesh. Lets say this is my mesh: ...
0
votes
0answers
6 views

How to copy object animation with bones with Python script?

I have an animated object, which is animated by bones (armature). I want to make multipel copies of this object (with its animation) by Python script. When I copy the object directly, the bones are ...
3
votes
1answer
37 views

How to get pack project status

I was wondering if there was a way to get the status of the project, whether it's Packed or not in python, and in the case how to get that information, I checked the api but with little success. Not ...
1
vote
0answers
11 views

search folder and import each file by script (ver. 2.79b)

Aims: I have a displacement modifier applied on the object. Image files were put into a sub-folder. I wanted to use script to search the sub-folder, replace the image(used by displacement modifier) ...
0
votes
0answers
15 views

How to compile Blender 2.8 into a python module? (bpy)

in order to start tinkering with 2.8 add-ons and scripts I tried to compile the Blender source into a python-module. I tried to stick to this guide but it seems, the process has slightly changed ...
2
votes
0answers
19 views

Subscribe to 'Finished' event of modal operator and get result of the operator

I am currently writing a python script and call a modal operator of an external addon like this: bpy.ops.uvpackmaster2.uv_pack("INVOKE_DEFAULT") My problem now is, ...
1
vote
2answers
143 views

How to make multiple float property in python

What is the python code to make multiple float property like in the mapping node?
1
vote
2answers
28 views

Get particle location using python

Is it possible to get the location (world space) of every mesh particle of a particle system and following that the vertex locations of every mesh particle using python?
0
votes
0answers
23 views

Interactively changing a python code?

is it possible to iterate through a python code ? For example I need to do these ops ...
1
vote
0answers
18 views

How to control the angle of pie menu?

I have made a pie menu like this for my own usage But actually I want it to be like this: Are there any way I could do it?
2
votes
1answer
54 views

How do I get a clean slate after every run of my add-on?

So I have been working on an exporter as part of my Google Summer of Code project. As I am new to Blender add-on development, I was under the impression that my code would get a clean slate every time ...
0
votes
1answer
22 views

Change from global to local

I am working in global, however when I enter edit mode I would like to change to LOCAL. The python code is missing something. bpy.context.scene.type = 'LOCAL'
1
vote
0answers
74 views

How to remove every inactive/unused screens in python?

in blender you can easely create thousands of screens. i'd like to have every screens from bpy.data.screens that are not visible deleted, how can i do that ? i know that ...
1
vote
1answer
61 views

How can render a video skipping frames based on any arbitrary rule?

Say I want to render every other frame in the first minute and only every third frame in the second etc? Edit: I need the output to be one video. Best way for me would be to generate an array of ...
1
vote
0answers
43 views

Check if name_space handler exists

I made a reusable overlay handler that just prints some text and then gets removed after n seconds, I need to remove the handler if it exists, I am currently doing this (which is horrible code I know):...
2
votes
1answer
34 views

How to know if the 3d-view is in camera mode or not?

I'd like to know if the context 3d-view is in camera mode or not using python? What is the code for that, I can't find it in the API.
3
votes
1answer
81 views

How to pack data into .blend with bpy.data.libraries.write

I have noticed that it is a discourse of which one speaks little, the correct way to write a .blend file and save objects etc is for example ...
0
votes
0answers
18 views

paste text from clipboard as a transform with a script

I have got a lot of text objects in a scene and each text object has a number that represents a value on Z axis. For example i have an object that contains text "410", which then should have transform ...
0
votes
0answers
13 views

How hide all except 1 or more object with python (2.8)

I Try to write script to hide 1 or more object but the problem is If in the for cycle have some objects already hidden the return to the previous condition, that is, some visible objects and others ...