Questions tagged [scripting]

Questions concerning scripting in Blender using the Python programming language. Also use this tag for questions about scripting in OSL (Open Shading Language).

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

I want to detect if an object is inside another [closed]

I am writing a program where I need the program to see If an object is partially or complete inside of another one. I have looked online but couldn't seem to find anything matching my problem. I would ...
1
vote
0answers
22 views

Bmesh: How to select newly created vertices?

I'm running bpy.ops.mesh.knife_project(cut_through=True) using an Edge to Slice a mesh. Next I want to select newly created Edge loop and remove all other vertices. I'm thinking of capturing two ...
0
votes
1answer
15 views

What does `filter` parameter of Template_id do? and How to use it?

In blender docs template_ID(data, property, new='', open='', unlink='', filter='ALL', live_icon=False, text='', text_ctxt='', translate=True) ...
2
votes
1answer
128 views

How can I get the scene polycount in python?

Is there any access in the python API to get the total scene (or object) polygon count? This info is already displayed in the status bar, but is this info exposed in the python API or do I need to ...
1
vote
0answers
26 views

Brainstorming Recreation of MODO Contour Tool

currently working out how to reproduce MODO's contour tool in Blender. I've tried a couple methods and ran into road blocks. Below is a snippet into my attempts. Ideally this script would be a low ...
2
votes
3answers
54 views

iterate over edge indices list and remove the non unique pairs

I have generated some random points on the xy plane. I want to connect a spline to the closest pairs but not having more than 1 spline connected any one point. I have used the "Find Close Points&...
0
votes
1answer
15 views

Creating Sub Panel RNA AttributeError: 'RNA_Types' object has no attribute 'panel'

So I've had a look at this blender stack exchange thread: How do a create a foldout UI panel? and this reference here https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/UI_API#...
0
votes
0answers
17 views

How to differentiate clicks on UI-elements and clicks on 3dview (or any region) In modal functions?

I'm using a raycasting(by left mouse button) approach to create some functionality in my add-on. The problem is when I click on UI, in addition to the button-operator the raycasting processes still ...
1
vote
1answer
41 views

How to draw Inputs from Geometry nodes modifier in a panel

I am trying to draw the inputs of the Geometry Nodes modifier to a panel, and I tried doing this ...
0
votes
0answers
10 views

I am having a keyerror issue [closed]

I tryed to export a avatar for VRchat. And it says this. ...
1
vote
2answers
48 views

Cut angular section (pie section) out of cylinder

In general, I'm wondering how to cut a pie slice out of a cylinder. I have done an extensive search and I'm sure it's not that difficult, but I haven't managed to find anything I could apply (possibly ...
0
votes
1answer
16 views

Select boundaries of uv islands in 3d viewport

I need to select edges of all uv boundaries similar to how i can select all seam\sharp edges with shift-g menu. I was thinking of solution where you (using python) ...
2
votes
0answers
16 views

What does use_property_split and use_property_decorate do?

So I've been trying to figure out what use_property_split and use_property_decorate does. I've roughly figured out what it does but since there is no documentation on the official documentation I can ...
0
votes
0answers
10 views

Spheres with csv file [duplicate]

Is it hard to do a script where I can create a lot of spheres? I have a csv file with x,y,z,r (radius) coordinates. I saw some topics but nothing worked to me.
0
votes
0answers
23 views

Getting the colour information from texture at ray intersection using BVHTree returns wrong rgb value

I am trying to achieve the effect shown in the following picture in Blender: That is done in XSI's ICE, which has an inbuilt function for retrieving colour info via raycasting I came up with the ...
1
vote
1answer
34 views

FileNotFoundError: [Errno 2] No such file or directory - Blender Python API

Hello Blender Community, With my groupmate, we are working on a traffic simulation on Blender as our graduation project. Initially, the simulation engine runs and outputs a .txt file, sim_log.txt, ...
0
votes
0answers
21 views

Multiprocessing in Blender 2.92

So I've tried to modify this script https://gist.github.com/knowuh/48136d7a17387e7cf6c3 (few changes due to updates) which creates voxels from each pixel of an image into a multithreaded program, that ...
1
vote
0answers
10 views

How to script the motion blur shutter curve?

I am trying to script the motion blur shutter curve (image below) for each frame of a render. I want to control the "openness" of the shutter curve with a list of values between 0 and 1. ...
1
vote
1answer
23 views

How to “refresh” variables / selected components for an operator in python script?

I'm working on an addon changing selected verticies per keyboard. It collects data: ...
1
vote
0answers
42 views
+50

Rigify: How do add a new Main Property?

Rigify's UI supports having certain Main Properties show up in its side panel depending on what bone you have selected. These are defined in the rig_ui.py, starting about line 733. What exactly would ...
-1
votes
0answers
36 views

Rendering script for not crashing when rendering animations with eevee [closed]

I have found a script to render animations frame by frame to avoid crashing all the time. But the script doesn't work for me can you please tell me what it's wrong with it? I found the script here. ...
0
votes
0answers
26 views

add on is appending from same file

I have two add ons that append .blend files. they use almost the same code however I changed the name of the class's and file names. but both add ons are appending from the same file. I'm new to this ...
1
vote
1answer
18 views

Removing animation keyframes outside of a specified range

I have over 1000 animation files that I want to "crop" off keyframes outside of a specified range. Keyframes all start at frame 1 instead of frame 0, as such I want to shift all keyframes by ...
1
vote
0answers
60 views
+50

Need WORLD XYZ from Camera x/y/depth

Currently using location_3d_to_region_2d within a script to get the screen-space coordinates of each vertex. I need to do the reverse -- given a Cam and X/Y/depth get X,Y,Z world space. I've ...
2
votes
1answer
51 views

Is it ever ok to use bpy.context instead of operator context?

I wouldn't say I'm a new developer but certainly still amateurish in the Blender API ways. Basically, I'm kinda tired of passing context to every single class and function XD Examples: Can I use <...
4
votes
2answers
208 views

Shifting face vertex order

I need to shift the order of referenced vertices in a face. I've been trying to do it in python after being unable to find a "normal" way of doing it, but I've hit a bit of a dead end and I ...
0
votes
0answers
21 views

Python: How to create an object which in not conneced to data

Good day. How can I make an object in Blender such that it is not linked to any object data? I am using animation nodes and would like to use the script subprogram to make create an variable number of ...
1
vote
0answers
33 views

Addon scripts overriding each other

I am having some trouble with my add ons. basically i have two add ons that append . blends. but they are both using the same script. so whenever i run the second add on it replaces the other one. I ...
1
vote
0answers
20 views

Keymap of my addon gets lost after restart (solved)

I've scripted 4 custom pie menus for my own workflow and put them in one .py file including individual keymaps (A,S,D,Alt+A). The menus work fine and when I import the addon (prefs, install addon, ...
1
vote
0answers
12 views

Script for repeated import and export

I have to create a movie by importing single stl objects, which represent the object at a specific time frame, onto a background and export them to single pngs. After that i can put them into a video ...
0
votes
0answers
33 views

How is matrix_world calculated?

I have been searching about this but haven't found any information on this topic, and Blender docs are not very explanatory for bpy.types.Object.matrix_world: Worldspace transformation matrix Type ...
0
votes
1answer
19 views

Blender python screenshot wait

I am new to python and blender.. But an old c/c++ dev years ago with working knowledge of c#. So concepts are OK.. But knowledge poor lol. I have a script that creates some text then rakes a ...
2
votes
0answers
18 views

How to prevent objects inside a collection from contributing to the scene statistics

I always have multiple collections but always one for Scale References. In Scale References collection I have multiple real-world-scaled objects that I am always visually comparing with, but of course ...
1
vote
1answer
23 views

How can I assign string variables to an object selection list

I wanna make a script witch automatically connects my sim geo to my high res geo with a Surface Deformer. But Object lists only accept objects, not strings. Is there any way to convert strings to ...
0
votes
1answer
43 views

Renaming Animation Channels with a Script for dummies

Say I have a channel called: pose.bones["mixamorig:LeftShoulder"].rotation_quaternion But I need it to be: ...
0
votes
0answers
19 views

Blender (2.92.0) Python vertex colour based on location

I have the following python code for colouring the vertices of an object in Blender (using Blender 2.92.0): ...
0
votes
0answers
25 views

“Recycle” a Blender instance

Summary Hi, I'm trying to optimize a RESTful service, that creates a 3D-Model (.blend/.gltf) from Shapefiles (...
0
votes
2answers
22 views

Script for making every material one material per one object

I need some help with making a python script. Anybody know how to automatically duplicate any material that's linked to multiple objects so that there is one material for every object? For example, ...
0
votes
0answers
26 views

Batch auto renaming materials to object name

I got a Python script renaming materials to their following objects. This is useful when I bring in Alembics from Maya - I set up a scene re-naming all the materials to the object it’s applied to, ...
0
votes
0answers
14 views

Attain Pixel Color From Texture Image

This question is in relation to the question in the link below: Get RGB value of texture from face on mesh Is it possible to edit/add code to the script to do the below using one image?: Select the ...
0
votes
0answers
16 views

Spline IK Offset/Movement Issues

I'm updating my old PRR T1 rig to do additional renders, and I really hate the way I had previously set up the rail tracking. I thought there would be a better way to do it via spline IK but I'm ...
0
votes
1answer
41 views

Transforming armature bone by matrix of another bone in pose mode

I am attempting to move an armature bone in edit mode by the inverted matrix of another bone in pose mode. My reasoning for doing this is because I have joined two armatures and have lined the bones ...
0
votes
0answers
21 views

How can I Apply material nodes when click image on Enum with Python?

I want my shader nodes to apply to an object when I click the image inside Enum I am using the Enum template ...
0
votes
1answer
31 views

Create cube in bmesh at given position in a efficient manner

I want to create a cube in bmesh at a specific position. How can I accomplish this? I'm interested in as efficient solution as possible btw... there will be A LOT of cubes to create every frame.
0
votes
0answers
17 views

Blender API - Repair meshes, similar to Windows 3D Viewer?

I have a question about repairing an stl, particularly after a Bollean union. I've been working on a script that allows me to make customizable game pieces for 3d printing. It involves combining a ...
0
votes
0answers
23 views

sys.executable returns None with custom python installation

I'm using Blender 2.92 (Windows 10) and it finds my Python installation in my Anaconda virtual environment as I have replaced its default python with that of my virtual environment using a hard link ...
0
votes
0answers
13 views

Creating a driver that references a value at a given frame

Is there a way to create a driver, that reads a value at an arbitrary time? Example: An object that follows an other object with a delay.
0
votes
0answers
10 views

Blender Python - How to activate selected objects? [duplicate]

Im writing a script to automate a few tasks in blender. The script performs the following tasks: 1st set of similar objects creates a new material puts the new material in the 1st material slot ...
-1
votes
0answers
12 views

Get bounding mesh vertices what are visible from the top side

I would like to generate a vertex array from an object like attached. This script success if the result like in the picture [ Another aproach: visible vertices from the top side. ( I found scripts in ...

1
2 3 4 5
98