Skip to main content

All Questions

Tagged with
0 votes
0 answers
16 views

Continue baking after changing modifier and adding a new object

blenderers! I want to write a Python script to simulate two clothes being dropped on top of a cube. Here are the steps that I want to take: I want to drop the first cloth and simulate the physics for ...
Aslan Noorghasemi's user avatar
0 votes
0 answers
25 views

Delete vertices one by one, when using the 'Add Mesh: Extra Objects' addon to plot points

I am using the 'Add Mesh: Extra Objects' addon in Blender to plot points at specified coordinates. Each point is added to a mesh of points instead of being a separate object. My goal is to implement a ...
crisplettuce's user avatar
1 vote
1 answer
31 views

How to Set Object Viewport Colors Based on PBR Material Properties?

I'm trying to create a script in Blender that sets the viewport colors of objects based on the properties of their physically-based rendering (PBR) materials. However, I'm encountering difficulties in ...
Larry's user avatar
  • 11
0 votes
0 answers
37 views

Automated rotations

I am stuck on a problem in Blender. I am trying to create a function that automatically aligns an object based on its dimensions to the world axis. This mean for example the largest axis will be ...
Alessandro leone's user avatar
0 votes
1 answer
25 views

Changing the size of the box by the user

I want to create a box, export it using Blend4Web to html and post it on the site. And so that the site visitor chooses the width, height and depth of the box. I need these parameters to be changeable....
fornit32's user avatar
0 votes
1 answer
33 views

Align vertices behind each other

Have seven objects behind each other in a straight row and aligned with x,y axis. Zooming in, the vertex's from each object does not align to each other. Here and there they do, most are scattered. Is ...
Tekkies's user avatar
0 votes
2 answers
94 views

Adding a camera in front of an object based on xyz rotation (Euler to Spherical conversion)

About the script: I would like to add a camera in front of a selected object. The front of the object is based on a calculation using a pre-defined polarangle, azimuthal angle and distance. The ...
Sneider's user avatar
0 votes
0 answers
37 views

Blender 3.6.2 > Move a selection of vertex's from selected vertex

Have a object (10 disks with 5 round holes in them). After selecting a cluster of vertex (total 4) the script need to: Move selected cluster down by 1mm Select next cluster (to the left) and move ...
Tekkies's user avatar
2 votes
1 answer
165 views

How to loop duplicate one object on top of all selected objects?

How to loop duplicate one object and translate the copy origin on top of the origin of all selected objects (origin position in the belonging objects unchanged) one by one with a python script? Edit ...
Mijeka's user avatar
  • 23
3 votes
3 answers
341 views

Blender Python: How to test for "selectable" objects in viewport?

Is there a way to check if objects are selectable in Blender Python? The code below checks if an object is visible, but is there also something to check if an object is also selectable in viewport? ...
Christoph Werner's user avatar
1 vote
1 answer
40 views

Scaling multiple independent meshes in an object from their centers, and, scaling only meshes whose centers are engulfed within specific coordinates

In the MWE (Minimal Working Example) below I created 4 spheres and placed them at 4 different locations along the Y-axis. I would like to scale each sphere as per my wish (lets say 2 in the X,Y,Z). <...
Saideep's user avatar
  • 105
3 votes
3 answers
591 views

Generate non-overlapping spheres having different diameters in a cube

I would like to generate a 'N' number of spheres having different diameters within a cube. The condition is that the spheres shall not overlap. I use the following code to generate spheres (random ...
Saideep's user avatar
  • 105
0 votes
0 answers
33 views

How to lock an updating object to the screen using scripts (Blender 3.5)

I wanted to create an object that automatically updates with scripts and displays on the screen in a fixed position in Blender viewport. Kind of like how 'Objectives' in the top right of the image ...
tranade's user avatar
0 votes
1 answer
146 views

RuntimeError: Error: Object ‘Base_01_Low.001’ can’t be selected because it is not in View Layer ‘ViewLayer’!

How can i add the object to a view layer? I mean not just with code, but even manually how can i do that? i trying to execute a script and first time it works fine, but second time it gives an error ...
Adam Szalai's user avatar
0 votes
1 answer
226 views

'Scene' object has no attribute my_tool after changing import method from classes to modules in __init__.py

Everything worked until I reworked my import methods to import modules instead of every single class. Now, however, my my_tool call does not work anymore because I can't simply use type=...
caddev20's user avatar
3 votes
1 answer
211 views

How to speed up hiding thousands of objects

I need a quick way to hide thousands of objects in the view layer via python. I have tried running the following code, but it takes 10 seconds to run with 10,000 objects: ...
Christopher Gearhart's user avatar
1 vote
1 answer
150 views

How to remove unused material slots in all objects if the objects are not selected? [duplicate]

Please tell me. How to remove unused materials in all objects if the objects are not selected? I tried this code but didn't get what I wanted. This code does not remove unused materials in unselected ...
Ruslan's user avatar
  • 11
1 vote
1 answer
26 views

Is there a way to automatically discard shapekey "offsets" for individual verts, based on their difference to basis?

I know this is the sorta thing you'd usually code up with a simple script, but I'm absolutely python illiterate. As far as I understand, shapekeys internally store their offset to basis when they're ...
Apois's user avatar
  • 33
2 votes
1 answer
95 views

Create 3D buildings model from real data with a right trade-off between realism and scene size

I'm creating a 3D model of a real large area encompassing 611 square kilometers (236 square miles). I want the model to include the relief map plus the buildings from the main towns in that area. I ...
Antonio Serrano's user avatar
2 votes
2 answers
276 views

Set the distance of all selected objects to another object to be the same

I wonder if there is a way to solve this problem. There are several objects whose size and position are identical. And there is a single terrain mesh. I want to position these objects with always the ...
ahmet oru's user avatar
1 vote
1 answer
99 views

Assign different materials to different object copies

I'm trying to create two different copies of an object with different colors. The code below will create them but they always end up with the same color (1,1,0,1) (yellow). How can I get ...
Matt Majic's user avatar
0 votes
1 answer
519 views

How to batch export multiple meshes into separate .ply files?

I have looked into batch exporting scripts and they seem to come in every format except ply. I'm having trouble understanding how to edit the template batch export script blender provides to export ...
Jubel's user avatar
  • 1
2 votes
2 answers
204 views

Getting the direct objects contained in a collection

I'm using collection.objects to ask for the objects in a collection, and it gives me the whole object hierarchy. How do I get just the root of the hierarchy? So for ...
TomMelson's user avatar
3 votes
1 answer
567 views

How to calculate bounds of all selected objects BUT follow the Active Object's Rotation at the same time?

[ Working code at the bottom, just paste in Blender's text editor. ] There are similar Bounding Box questions out there but this is different, please don't close. I made a script which iterates ...
Armored Wolf's user avatar
1 vote
1 answer
319 views

How can I copy objects without linking data via python?(deepcopy)

How can I copy objects without linking data via python?(That is deep copy the object data.) I'm using this to copy objects, but the new object's data linked to origin. ...
Tac's user avatar
  • 85
0 votes
0 answers
48 views

Script measuring bounding box size of selected objects, and copying those values into the objects' viewport colors (XYZ = RGB)?

I'd like to find a simple scripted way how to: measure the bounding box(es) of a selected object(s) take the XYZ values, and convert them into 0 to 1 numbers with the correct ratio Feed these three ...
Matěj Šak's user avatar
0 votes
1 answer
133 views

Get the XYZ Dimensions of an Object and Rename to those values?

Very new to scripting but utilize it's magic in nearly every .blend I think most of us are familiar with Quixel's awful naming conventions but to give a sense of size in the Asset Browser, I figured ...
brent.blend's user avatar
0 votes
1 answer
218 views

How to copy Names from a selected multiple objects and paste it (combined) into another using a script?

in my work I must do a lot of copying from different multiple objects and combining those names, pasting into final objects name. I was wondering if that can be done with a script.
Remigiusz Papaj's user avatar
1 vote
1 answer
424 views

"context is incorrect" while using handler

This simple script rotates a monkey: ...
Petr's user avatar
  • 21
2 votes
1 answer
464 views

Get an object from unique identifier(memory location, id etc)

First of all, I'm new to blender scripting. I'm looking for a way to uniquely identify an object, something that will reference the same object regardless of renames or any other changes in the scene. ...
Michael777's user avatar
4 votes
2 answers
860 views

Bpy get the name of a collection an object belongs to

For an if statement, I want to check if my current object is in collection 'coll' Here's what I have so far: ...
Zak Nelson's user avatar
0 votes
0 answers
41 views

How to create some points attach to an object using script?

The question is I want to create some points which construct the area enclosed by brown lines in front for the sofa.This area is attached to the sofa and it will follow the action of sofa such as move ...
P. Scotty's user avatar
  • 321
1 vote
1 answer
234 views

How to select a collection from the 3D viewport by right-clicking on one of the objects in a collection

Recently, I asked a question about how to select a parent directly from the viewport by right-clicking. However, this time, I would like to know if it is achievable to select a collection using the ...
Yousuf Chaudhry's user avatar
0 votes
1 answer
2k views

AttributeError: 'Object' object has no attribute 'origin_set'

I'm writing a script to create a cubical object out of several joined planes. After joining the meshes into one object (shadow_catcher), I need to set its origin to ...
Tal Taiber's user avatar
0 votes
0 answers
85 views

How to use the same function on each object in the collection using script

How to select objects in the "Cube" collection one by one Deselect the active one, select the next one from the list and perform x10 scaling operations on it. in script For example Cube (...
Andrzej Panna's user avatar
1 vote
1 answer
331 views

An array of 3D arrows (python in Blender)

I am new to Blender and I want to create an array of 3D arrows; the array itself is 2*2 (constant space between each object) but the arrows are 3D. I hope to write a python code for it but I don't ...
Rex's user avatar
  • 11
0 votes
1 answer
464 views

How to set up driver via python script between Custom Properties of objects?

I want to set up drivers: from Custom Properties of a Camera to Custom Properties of selected object. Based on a script from 6 year old post: How to put together a driver with python, I manage to ...
evilferber's user avatar
2 votes
1 answer
1k views

How to code min and max values for custom property to selected object?

The following script creates Custom Property "TheNameOfTheSelectedObject_MyFloat" to the selected object, but it doesn't have "min" and "max" values: ...
evilferber's user avatar
1 vote
1 answer
98 views

I want to define some properties for an object by myself

...
P. Scotty's user avatar
  • 321
1 vote
1 answer
93 views

Iterating through a collection and assigning a material to each object based on csv

I am trying to take the 1s and 0s in the B column, and use those to apply the mat_available (1) and the mat_occupied (0) to the planes. I am a beginner in python, so my knowledge is limited. I was ...
Furm's user avatar
  • 11
1 vote
1 answer
237 views

Type Error: self.text

After learned about new changes in blender API, I had to update script from 2.8 into 3.0 using : instead of =. So following the ...
sirrus's user avatar
  • 169
1 vote
1 answer
890 views

How to resize an object proportionally via setting edge length?

I'm trying to scale or resize an object to a specific size by picking an edge from that mesh, and then setting that edge to a new measurement, automatically resizing the whole object proportionally. ...
Emet Derek's user avatar
0 votes
1 answer
36 views

Joining & Rotating objects created in code through loop

I'm a Blender & Python newb, so the nuances haven't been all that enjoyable :) I'm trying to create a 1x2 stack of cubes that joins and rotates each layer by 45 degrees. Below is the code I have, ...
Mantis Head's user avatar
6 votes
2 answers
1k views

Print Material Color of Active Object

I feel like I'm close on this one. I am trying to print the material color of the active object. Currently it is printing a value, but when I select a new active object, it prints the same value. I'm ...
MrP's user avatar
  • 135
3 votes
1 answer
191 views

How to select all related objects?

For example, there is cube that have boolean modifier with sphere object and sphere object also have union boolean with torus, and the cube also mirrored with empty object as origin. The question is, ...
CheatPekalongan's user avatar
0 votes
0 answers
23 views

line in the center of the head using facebuilder

Hello. I made this head using an addon called Face Builder. Is there any way to get rid of this line appearing above my head?
stone harris's user avatar
2 votes
2 answers
2k views

How to access objects in Blender

I found this code I want to use: ...
Dirk Schiller's user avatar
-1 votes
1 answer
573 views

How to see a active shape key's name?

In the following source code, "obj.name" and "obj.data.name" work fine. But "obj.shape_keys.name" doesn't work. T.T I wonder how to fix it. ...
minia's user avatar
  • 45
4 votes
0 answers
127 views

Is there a way to make an object not-deleteable?

I'd like to have an object that has some sort of special property so that it can't be deleted by accident. for example: if I press X, it will not delete this object but will instead deselect it or ...
Zophiekat's user avatar
  • 759
3 votes
1 answer
395 views

How can I purge recently deleted objects?

...
APEC's user avatar
  • 590

15 30 50 per page
1
2 3 4 5