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 [scripting]

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

0
votes
0answers
9 views

Impossible to invoke a message inside of a timer app?

impossible for me to incoke a message within a timer app? is it normal? is it a bug? should i repport it ? for this message system: ...
0
votes
1answer
16 views

Changing the name/icon/function of menu/pie menu/panel with a condition?

for example in this pie menu below ...
1
vote
1answer
25 views

How to specify number of cuts for subdivision modifier in python

I'm working on a custom panel in Blender. I can add a subdivision modifier with python like this: ...
0
votes
0answers
18 views

Placing cubes in a grid is very slow (using python script)

I'm trying to generate a scene comprising of voxels generated from a 3D data matrix. However the script that I'm using is super slow (~1h per image), and most of the time is consumed while building ...
0
votes
1answer
9 views

Center 3D cursor with script

I am trying to set the 3D cursor to the center using a script, so that when it then imports an FBX it is based on that cursor location. So far I have this: ...
0
votes
1answer
14 views

Execute a specific action on the first run of the script?

Id like to execute different action on the first run of the script for example the first try i want to execute: Print("First Hello") and on the second run. <...
0
votes
1answer
61 views

Do an action automatically every n minutes with Python?

I want, for example, to move the context.object every 10 minutes automatically. So no action needed, if I run my script the first time it will activate this incremental action, and if I run it a ...
1
vote
1answer
23 views

How to find the highest end value of nla strips in a group of objects?

I have a group of objects in my scene that have animated materials. I've converted the material animations to NLA strips, and am trying to find the highest value in the list of end frames that the ...
0
votes
0answers
13 views

Blender - export bone rotations in each keyframe to a text file

I would like to write a script to accomplish this can someone help me, thanks!
0
votes
0answers
5 views

Detecting objects within frame’s camera FOV

In Blender 2.80 EEVEE how to enumerate a list of all objects it has to render in a given animation frame? Alternatively how to test if a known plane is in the FOV on a given animation frame? Thanks!
1
vote
0answers
9 views

Multiple video segments in multiple textures

Animating video plane movements for EEVEE in Blender 2.80 that pass through the field of view of the camera in combinations: The h.264 video file is long. To start each plane on a different frame ...
1
vote
0answers
12 views

How to hide/show Collections levels with python?

Hello in this code below i create a lot of collection and add backups inside of them, its kind of a cool withing the file backup system ...
0
votes
0answers
10 views

How to export Bone Weights?

I am editing the default OBJ exporter of Blender (io_scene_obj) to create my own version which supports bone weights, for skeletal animation. I now know how to access the bone weights per vertex in ...
1
vote
1answer
34 views

Disappearing metaballs when creating with Python

I have created a simple addon that creates a series of metaballs. Sometimes when the addon executes, the metaballs are rendered invisible (as only outlines, no surface). Usually the metaballs seem to ...
0
votes
0answers
12 views

Automation of the same type of renders

I have many profiles in curves (10+, maybe even 50+). For example: Each of them should be extruded and placed on the wall like this, and render. Is it possible to automate the process? Or at least ...
0
votes
0answers
13 views

Running Modal Operator based on condition: Is this legit?

I am using a Modal Operator in my add-on and would like to know if it is a bad idea to use the same Operator sometimes modal and sometimes directly: ...
0
votes
0answers
22 views

Red images when taking screenshots from script

I'm running this extremely simple script in Blender 2.79b: import bpy bpy.ops.screen.screenshot(filepath="file.png", full=True) And I'm doing so just like this: ...
0
votes
0answers
10 views

Script has no errors but is still not working

Hey everyone I am creating a simple pie menu but it doesn't seem to be working. I was trying to do this for 2.8. Here is the code ...
0
votes
0answers
11 views

How to have a script affect all selected bones?

pretty nooby to python here, so go easy on me. I’m trying to set up a script that will fix the bone connections of models exported from source filmmaker. I’ve made a script that works but it only ...
0
votes
0answers
6 views

Python bone Location/Rotation matching with offest

I want to copy modifications made on a rigged set of bones over to a second set of bones. The bones have completely different orientations but seemingly work the same (a rotation is a rotation after-...
3
votes
0answers
23 views

is there any way to get to velocity of a fluid and use it in the cycle material editor

I'm trying to use flip fluids to make lava is there any way to use the motion blur vectors, or get the velocity to mix a material. or in the script editor is there anyway to drive that.
2
votes
3answers
56 views

Mesh reverts back to the state before the script was run

I created a script (operator) that converts a selection of quads into a diamond pattern. It works fine but when I try to Inset the newly created selection and change any of the options (like ...
1
vote
2answers
89 views

Dividing terrain mesh up into multiple tiles with script - border gap issue

Having found a fantastic Script for dividing up terrain from user batFINGER within this post - blender.stackexchange.com/questions/80460/slice-up-terrain-mesh-into-chunks/133258 ...
2
votes
0answers
30 views

How to make a spiral torus?

How to make a spiral torus as shown below? I do know how to make various spirals in Blender, but this one escapes me and makes my head spin (forgive the pun). I believe it consists of several torus ...
0
votes
0answers
13 views

How to force an update when data changes in the VSE?

I'm trying to figure out how to synchronize VSE strips with NLA strips in realtime using blender. The goal is to be able to control multiple NLA strips with a single VSE strip. I've written a script ...
1
vote
2answers
36 views

Modal Operators: Click Object Event

I'm currently working on a python tool using a modal operator. Now I know to finish the operation I can use: if event.type == 'LEFTMOUSE': return {'FINISHED'} ...
0
votes
1answer
27 views

How to update values based on existing properties via Python?

I've written a script takes the start and end values of a VSE strip, and copies those values to the NLA strip of a selected object (effectively syncing the NLA strip with the VSE strip). The script ...
0
votes
2answers
21 views

Adding a random offset to drivers

So I want to animate multiple "cables" (witch are curves), i want to animate the bevel start (or end) and add a random offset to this value. I could put some keyframes and offset them manually but i ...
0
votes
1answer
39 views

blender 2.8: 'Object' object has no attribute 'hide'

Code from example: import bpy bpy.ops.object.select_all(action='DESELECT') for ob in bpy.context.scene.objects: if not ob.hide: continue ... ...
1
vote
1answer
40 views

For Blender, which is the better language to learn - OpenGl or OSL? And why?

I have only yesterday started to learn OSL. Since OSL tutorials are scarce in Youtube, I am beginning to wonder if OSL is becoming obsolete as I get the impression that it is overshadowed by OpenGl. I ...
4
votes
0answers
41 views

How to draw a circle on a plane with OSL (Open Shading Language)?

This is my very first day of learning Open Shading Language. I have watched few videos in Youtube and learned a little. Right now, for learning purpose only, I want to know what OSL codes can draw ...
0
votes
0answers
10 views

How to retrieve contact forces from impulse in Blender?

I am working on retrieving contact forces during a simulation in Blender, I wonder to know is it possible to retrieve contact forces from collision impulses calculated by Blender and if yes, I wonder ...
0
votes
0answers
21 views

Rotoscope Animation to 3D

here's what I wanted to do: I'm manually rotoscoping a 4 seconds animation. I'm only tracing black lines over transparent background (png format) I had a script in processing that read images and ...
1
vote
1answer
18 views

Blender adding double forward slash (`//`) to image file paths on Mac [duplicate]

TL;DR: Blender seems to be prepending spurious // before filepaths when loading images from script. Steps to reproduce: Save the following minimal script in a ...
2
votes
1answer
32 views

Different behaviour in script compared to Python Console

I'm running a script in Blender 2.79b to save 2D proyections of a 3D face model with annotated facial landmarks, I apply random transformations to the mesh and the landmarks, render the mesh and save ...
0
votes
0answers
16 views

Blender Net Render Save Render Image to given location

I am using Blender Network Rendering using python scripting. I am able to do everything except setting a path to save the still rendered image. So like for simple cycles rendering we use these ...
0
votes
0answers
20 views

Normal values not changing while chang normal in bmesh obje

I am using blender 2,79 and blender API to edit my mesh. Following is the my code.. ...
0
votes
0answers
19 views

Where should my add-on save its presets .txt file?

I created a script that saves all my Property Groups in some callable text files, it works fine, for now the path is ...
4
votes
1answer
35 views

Are Blender 2.79 and Python 3.7.X Compatible?

Blender 2.79 Reports its Python version as 3.5.3 Is the mix of Python 3.7.X and Blender 2.79 compatible? What steps should be taken? What is the estimated time for these steps? I am not seeking to ...
1
vote
1answer
30 views

Vector Math to Determine Gravity Path

I need to code a function that basically traces the path a sphere would roll when placed on a triangulated terrain. The image below shows the problem, but I haven't got a clue how to work with vectors ...
0
votes
0answers
32 views

How to select multiple Faces (Blender 2.80.0 Beta)?

Is it possible to select all the faces according to the pattern of the red dots?
0
votes
0answers
18 views

of a registerable rna type (ToolSettiRegister Addon: ValueError: register_class(…): expected a subclass ngs does not support registration)

This question follows: Blender 2.8 Python Addon: How to register a Button? Late thanks dr.Sybren! I like your "Scripting for Artists". Could you explain what you mean by "...class name should ...
7
votes
3answers
420 views

Replace matrix @ vector list comprehensions with something more efficient

I'm looking to replace list comprehensions like the following with something more efficient and I was wondering if numpy can be used. ...
0
votes
1answer
28 views

Select object from within collection

Can anyone tell me how I can choose an arbitrary object from within a collection? My script leaves me with nothing active (or selected) at one point, but I need something to be active. I have the ...
0
votes
1answer
22 views

Gradient-Coloring Vertices Based on Global Z-Loc Not Working As Expected

I tried to write my own code that changes vertex colors based on the vertex Z-location(global). Which I derived from these links: How can I get vertex positions from a mesh? https://blenderartists....
2
votes
1answer
60 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
2answers
30 views

Ctrl-C not working

I am trying to make an optical encoder, so I want to cut a lot of holes at even intervals around a disk. I am trying to make a macro to apply Boolean modifiers, rotate 5 degrees, and repeat. All the ...
4
votes
2answers
145 views

Change active object through scripting

Currently running 2.79 I'm having issues figuring out how to select objects: This is my code, what I want it to do is create two spheres, and then resize the first created sphere after the second is ...
0
votes
1answer
44 views

How to replace an existing material with one from other blend file with python?

Currently, I'm working on a lot of files imported from Autodesk Maya to be rendered in Blender 2.8 EEVEE. And of course, the material looks bad when rendered. And will be a lot of work to fix all of ...
0
votes
0answers
8 views

Update interface after selecting compositior node

This script should select specific Viewer node in order to get proper image for Viewer result (to get pixel values later) ...