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

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 ...
0
votes
1answer
82 views

Why is 'bpy.context.active_object.pose' of type 'NoneType'?

It might be my inexperience of reading too much technical documentation or little experience in python, but, I'm having a bit of trouble reading the documentation. The command that triggered this ...
1
vote
1answer
179 views

How to import a movie file in Blender 2.8 and 2.79 with Python?

I tried to add a movie file using this script in the scripting window. ...
1
vote
1answer
530 views

Problem with rotating objects by script

I have script (operator) which should align align all selected objects somewhat. ...
3
votes
2answers
904 views

Make a rotations-only parent BGE

There is a way to make an object parented to another object, but only for the rotations, not for the location. If i move the parent, the child may dont move. If i rotate the parent, the child must ...
0
votes
0answers
12 views

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 ...
1
vote
2answers
3k views

FBX vertex weight import problem

I am getting a distortion with a rigged mesh due to the way that Blender imports FBX files. This is due to some kind of loss of accuracy that occurs while importing the vertex weights. Here is a ...
2
votes
2answers
1k views

Move/rotate object depending on another object

I have an object Cube with copy transforms constraint targeting another object Empty. The constraint is disabled, so when I ...
0
votes
0answers
13 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 <...
0
votes
0answers
50 views

Stall code execution until modal operator is finished

I am trying to use an external addon and its operator which runs in modal mode. The solution that I would like to achieve is to stall the execution of my initial script that calls the operator until ...
1
vote
0answers
19 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, ...
4
votes
2answers
197 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
20 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 ...
0
votes
0answers
22 views

Blender 2.92.0 - MakeWalk - Load And Retarget [closed]

I use Character From ( Make Human) and I imported to blender I try Add BVH File to my Characterbut I faced This problem I cant Import BVH File when I do it by Make Walk My Character *.MHX My Motion *....
1
vote
0answers
29 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
11 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
31 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
40 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: ...
1
vote
1answer
22 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 ...
2
votes
0answers
17 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 ...
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
1answer
279 views

Best way to have text change during an animation?

The short version I want to create a very simple animation that will change the text of two fields based upon the time elapsed in the animation. I think that the python API is the best place to start,...
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
1answer
54 views

How create a ramp with angle with python script

I am learning how to use blender with python script. I want to draw a block with ramp. until here, I can generate a block but my problem is precisely on how do the ramp. if you can help me please. I ...
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
1answer
32 views

bpy add object in game

is it possible to add an object inside the game engine with upbge 3.X.X while having game physics work properly ? What I'm doing is: ...
1
vote
1answer
739 views

Renaming Animation Channels with a Script

I changed my armature bones and it screwed up my animation. I'd like to traverse ALL my animations and channels and change a specific channel name to the updated bone channel name. How can I do this ...
7
votes
2answers
1k views

Create a configuration window for my add on

I'm making an add-on that is supposed to take in a lot of user-decided configurations . I know I can create panels and stuff, but I'd prefer to create a configuration window that pops up and fills the ...
1
vote
1answer
190 views

Fast streaming camera view to video for linux (v4l) system device

What i'm trying to achieve is to stream an arbitrary camera view in blender to a v4l device. What i've done so far After reading the community post about streaming the Eevee view on Windows and linux, ...
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
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
1answer
26 views

how to send property value as a message sent by multiple object?

i was working on a game and i need to send multiple property values from different objects through different scenes using message body set to "property" any ideas ?
2
votes
1answer
133 views

How do I get vertex coordinates in the same units as the scene units?

I want to get the coordinates of a vertex in the correct units, millimeters in this case for the current model, to do some calculations in external to blender module. When changing the units of a ...
0
votes
1answer
28 views

How to open URL upon clicking an object? UPBGE/BGE

Hello. I wanted to know if it would be possible to open a website (hyperlink) after clicking on an object. Normally you can have a left button sensor and a mouse over sensor working together so that ...
0
votes
0answers
25 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
15 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 ...
2
votes
2answers
2k views

Get RGB value of texture from face on mesh

I need to extract the RGB information from a a face on a mesh with a script. I know it sounds ridiculous, maybe it is the main reason I could not find any solutions. I know the index of the face but I ...
0
votes
0answers
20 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
0answers
16 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
1answer
30 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.
2
votes
1answer
451 views

Create curve from Numpy Array using Python

I have looked through previous questions on this and many other boards and I cannot seem to find a previous answer. I have a largish Numpy generated ndarray that represents a harmonograph output (...
3
votes
2answers
402 views

Mirror object diagonally (or Symmetry about origin), i.e. excusively in X+Y

I'm trying to mirror an object like this (see picture) such that the mirrored object behaves exactly like it would using the Mirror Modifier - that is, mirrored transforms and mesh. Currently I have ...
0
votes
0answers
22 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
8 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
vote
1answer
166 views

How open file browser to save a new blender file

I'm trying to open a file browser (similar the browser in the image bellow) where the user can chose a folder and file name to save a new .blend file with the selected objects. I want make a addon to ...
1
vote
1answer
63 views

How to prevent a newly create window to change its content when switching between workspaces?

hello, how do i prevent this behavior of any newly created window /window dupplication ? i want the content of the window to stay the same when switching from workspaces to workspaces. can it be ...
0
votes
1answer
284 views

Scripts with sound path - Imported audio not working with Save Game as Runtime

I'm using a Blender 2.74 and am trying to pack external audio data into a .blend file. I am using Windows 7. If I try run my game on other another computer, everything but the audio seems okay. Here ...

1
2 3 4 5
97