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.

3
votes
0answers
17 views

When a Driver is being evaluated are the final positions of objects finished evaluating?

When a Driver is being evaluated are the final positions of objects finished evaluating? Does the Dependency Graph take into account references made in a Driver for a topological sort? The Blender ...
1
vote
3answers
56 views

I am trying to create a Script that does a Smart UV unwrap of seperate connected parts of a mesh

This is what I got so far. Note that I have a counter which I check with 10 while I'm testing, so it doesn't pass through everything, since it takes quite a while. The reason for doing this is that ...
0
votes
0answers
16 views

How would you make an addon both 2.7 AND 2.8 versions compatible? [duplicate]

Is it possible to put some sort of condition checking the user's blender version and depending on that make either register the class in old-fashioned way or the new API one?
1
vote
0answers
28 views

Blender 2.80: Different collections in each viewport

Is it possible to restrict visible collections in each viewport separately. Here is how it was done in 2.79 using lock_camera_and_layers
0
votes
0answers
21 views

BPY Convert gpencil to curves with a script?

I have a scene with a GP object selected, and tried to run a very simple script from the script editor: ...
1
vote
1answer
19 views

Do plugins/APIs exist to edit blender-python-scripts in Intellij IDEA?

I find the code editing environment on blender pretty stiff and it makes my development slower because I have to type every piece of code letter by letter so to say. I was just wondering if it were ...
0
votes
1answer
41 views

Correct way to delete double material on object by exact words inside

I try to excluding objects except 4 types, the objects in question have these letters in the name, but they are not always in the same place, for example ".Type1.001" to delete duplicate material , ...
0
votes
1answer
31 views

Circle Array Modifier for face rotation

I know how to add a circular array modifier, it is shown e.g. in a video like this: https://www.youtube.com/watch?v=whjFb0xFoLk But what I want to do is to create such a circular array that is ...
1
vote
2answers
76 views

Way to hide , (not hide_viewport) in blender 2.8

hide_viewport is the new api (old hide) but no have new api for "Close little eye" is possible? edit: For now this visibility (collection or object) is not expose in bpy,as Confirmed,with Medium ...
7
votes
5answers
598 views
0
votes
0answers
30 views

Error when use: bpy.data.collections.remove(my_coll) blender 2.8

I not understand if is a bug or is my mistake,that script work fine , but i not understand tipology of error, ERROR (bke.library): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\...
0
votes
0answers
25 views

Are there any tutorials/resources for generating objects in random locations?

I'd like to write a script that places 3 objects of my choosing in random places in all xyz dimensions (with constant size, but varying rotations and locations) and I'm wondering where I should go to ...
2
votes
1answer
60 views

How to correctly merge two objects in blender

I am trying to merge two close boxes into one single cuboid, from the GUI I am able to successfully create the two boxes and set a boolean modifier to the first box to unify(UNION) with the second box ...
1
vote
1answer
34 views

Problem with return super().__getattribute__(attr) blender 2.8

That script make this problem: return super().getattribute(attr) AttributeError: 'ParticleSystem' object has no attribute 'my_particle_settings' i think is a good solution , about create a particle ...
0
votes
0answers
12 views

How can I navigate 2d viewport (Image Editor) using Python?

I want offset 2d view with specific vector. Can find way to do it.Please help. I have tried this way: ...
0
votes
1answer
49 views

Button callback based on the objects particle system?

I have button in my panel, that button switch emitter/hair in particle system it works, but the problem is i have many object, and if i change object selected, button not update.I'm looking for a ...
1
vote
1answer
46 views

Scripting:How to correctly add a boolean modifer to an object?

I am trying to cut a hole through a mesh-cube with a mesh-cylinder by adding a boolean modifier with a 'DIFFERENCE' value. what ...
0
votes
1answer
30 views

Way for delete all object inside an Collection “Mycoll” in blender 2.8

I find the bpy.ops, but not find the low level python way to get obj inside a collection and delete . Any idea?
0
votes
0answers
26 views

Pass values from python script to Blender and automate render(mp4) creation [duplicate]

I have a project in Blender that provokes a shape to move in certain ways based on two values (currently I manually change the values in the Python script in Blender and manually click to render to an ...
0
votes
1answer
42 views

Can python scripts be used to make a simple real time game in Blender 2.8?

I would like to use Blender for a python class project. Many students are writing simple games using pygame etc. Instead would like to write a simple game using blender+python. But - this is a ...
0
votes
0answers
7 views

Unix Filemodes for bpy.ops.wm.save_as_mainfile()

Is it possible to save a blender file from python with certain file modes (e.g. the octal notation like 775)? I checked the documentation on save_as_mainfile() ...
0
votes
0answers
9 views

Is there a faster way than this?: bpy.ops.object.duplicates_make_real( ) in blender 2.8

From emitter (hair) have large object , i whant make duplicate real but in python ...
0
votes
0answers
17 views

To access a sculpting tool via python

I'm trying to blender addon for VR. For that I need to access scripts of sculpting brushes. How can I do that. I know the fact that these tools are incorporated with the core of Blender which is ...
0
votes
0answers
15 views

Setting the rotation of an object by using different euler inputs

I have at least 20 objects in a scene, each having a name. "21" "22" "23" etc... all objects have the incorrect rotation xyz, which I would like to rectify with a python code. For example... I select ...
0
votes
0answers
35 views

Mesh from CSV data

I trying to create a mesh from GPS lat&long coordinates combined with WiFi RSSI data. When imported the data looks like this I've been playing around with different ways to create a solid mesh, ...
0
votes
1answer
30 views

Python code, copy dimension from one object to another

I require some help please. I select one object (A), then shift to select another (B). Then I require some python code to copy the X dimension from (A) to (B). The X dimensions for both objects are ...
1
vote
1answer
27 views

Render Audio on a machine with no sound card

I'm using VSE to create small video clips. I create the clips using python and render everything in the background. Now I am trying to add audio to my clips. This works on my local machine. This is ...
0
votes
1answer
31 views

Exporting rotations of selected objects to a text file

I am using this script which I got from the internet and it works perfectly for 2.79. Please could someone help adding selected objects rotation to export to the same txt file? In degrees.... Thanks ...
1
vote
1answer
33 views

Is there a way to access a bpy.types.Operator value

I have a popup that can allow the user the set a value. I can see that the value is getting set correctly as it reports it to the console. However after the function that calls the Operator ...
1
vote
1answer
54 views

Passing data from one running instance of script to the next

I am looking for the most efficient way to save data from one run of a python script to the next. My script generates a list , say presentList . The list is made up of a number of integers. Next time ...
0
votes
0answers
20 views

Snapping copies of an object to every vertex of another

What I'd like to achieve is a python script that when run, copies an object eg. some tree (preferably not cluttering up the object list), to every vertex of another object that works like a 'grid' ...
1
vote
1answer
33 views

API access for workbench render settings

In Blender 2.8 how do I change the settings for the workbench render properties via python? The settings for the workbench render, not a viewport. For example if I manually change the lighting to FLAT,...
0
votes
0answers
18 views

Explicitly defining property values in popup window?

I have been experimenting with manipulating popup dialog windows to have operators and dynamic UI but I do not know how to work with properties explicitly. I already know how to set default values ...
0
votes
0answers
31 views

See python error console in blender 2.8 [duplicate]

When running a python file in blender 2.8, I get the message Python script fail, look in the console for now. According to this question, I should be able to see the error in Window > Toggle System ...
0
votes
0answers
37 views

Popup during an import as a result of an exception

Is there an example of a popup window been spawned as part of another process? In my case I want to write an importer that will invoke a popup if an image path can not be found and allow the user to ...
1
vote
1answer
29 views

Python Script: Set Value for Modifier manually

Does anyone know if it's possible to write a python code that enables you to manually set individual parameters for modifiers? For example: Solidify-Modifier to set the wall thickness ...
2
votes
0answers
14 views

low level alternative for bpy.ops.object.data_transfer for weight copy

I am currently using this code for transfering weights from one obect to another: ...
2
votes
3answers
222 views

Python: Selecting object by name in 2.8

The following: bpy.data.objects['Cube'].select = True bpy.context.scene.objects.active = bpy.data.objects['Sphere.017'] don't work in Blender 2.8, they did in 2....
1
vote
1answer
45 views

a simple script not working in blender 2.8

This simple script below does work for blender 2.79 but simply won't show the properties in blender 2.8 (it does draw the panel but it is empty inside) ...
1
vote
1answer
51 views

python open file browser to Group directory of blend file?

Is it possible in 2.79 to open the file browser to the internals of a specified blend? I have a template.blend, that will have several Groups in it. Currently, I have a button that opens the file ...
0
votes
1answer
25 views

Why can't I move some of the objects in this model?

I recently downloaded this model of a car. This model consists of several objects. For some of the objects (such as "Neumatico"), I can change the location of the object using the Python Console with ...
0
votes
1answer
33 views

How to get a list of all unlinked objects in the scene with python?

For example, I am running this script: ...
0
votes
0answers
28 views

Make duplicate real to single object in Blender by Python?

Is there a way to turn duplicates (hair emitter objects) into a single object? i try with : ...
4
votes
0answers
44 views

Programmatically changing UV/Image Editor Image

For a school project, i am trying to combine openCV and Blender and for this very spesific reason, i would like to use Blender's internal Image Editor to show my frames instead of cv2.imshow() ...
0
votes
0answers
15 views

How do I trigger a function when a thumbnail clicked via template_icon_view?

I have a working script that does loading some icons and however I cant seem to find a viable way to do triggering when an icon is clicked. Imagine the internal matcap browser, when the user chooses ...
1
vote
1answer
20 views

How to make a bone active?

I am trying to select a bone and make it active in 2.80, so I can run an operation on it (connect it to its parent), the bone gets selected, but does not get active, as shown in the picture, when ...
0
votes
0answers
18 views

How to add my own function to 'Insert Keyframe Menu' pop-up?

I need your help :3 So, I made some custom modal function what interacts with bones in the way I want. Basically this function creates Bone Group with some bones (...
0
votes
0answers
41 views

Parent a shader node

It there an example of setting the parent of one shaderNode with another? Here I am trying to make the Bsdf Principled Node the parent of the Material Output node. ...
1
vote
0answers
23 views

Row Summing When Moving an Object

I am trying to move an object using coordinates from a CSV file. The file is written by one python script and then read by a script in blender. Below is the script written to read the file in blender ...
0
votes
0answers
34 views

Colors contour from Python

I have several hundreds of objects in a scene. I want to distinguish between them using colors contour. The color is interpolated according to the size of the object. Is there any possible way to make ...