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
2 votes
1 answer
966 views

How to save multiple blender scripts (text-files) at once?

I want to write a script that saves all the text files inside a Blender file. Is there a way I can access the text files as a list and then select them individually? Heres my script so far: ...
TYLRwithspaces's user avatar
2 votes
1 answer
253 views

How to use Python API to create an interactive parametric mesh?

I want to add my custom mesh to Blender. I already know about vertices, edges, faces, bpy.data.meshes, etc, but I can't figure out how to create an interactive ...
g2m.agent's user avatar
2 votes
1 answer
917 views

OSL Texture Mapping [duplicate]

I'm new to OSL and Blender. I'm using the following code to generate a circle on a plane. The plane, however, appears to be split into two triangles. Can anyone explain how to fix this so my OSL ...
Dr. Pontchartrain's user avatar
2 votes
2 answers
856 views

how to make an object follow a curve with the same speed as another animated object

Say I have an object which has an animation. I have another object which is constrained to a curve. I want it to follow the curve BUT I want it to do it at the same speed as the animated object. ...
nav9's user avatar
  • 23
2 votes
2 answers
477 views

Scripting: Displacement modifier visual update required

started using blender recently (>2.8), and in particular I'm trying to do a lot of work via scripting and the use of modifiers. In particular, I'm generating a circle via modifiers, with a ...
Mr G's user avatar
  • 152
2 votes
1 answer
631 views

Get operator command from context menu?

Here is what I need to do: I need to add a button to this context menu (the one you get when you right click on any button): like the one I added here at the bottom. I am using this code from the ...
andesign's user avatar
  • 140
2 votes
0 answers
127 views

How to hide a panel that appears twice? [duplicate]

I'm making an addon where I added a panel to a popover button. See the following example: Here we can see (in image number 2) a popover button in Shadows. This panel is shown only on this button. I ...
niadhson's user avatar
2 votes
1 answer
678 views

Setup bones on cloth sim so that you can transfer it to Unity via FBX export

So, I would like to have this happen with a script for each vertice of an object: I just couldn't to make it work :/ Except only some parts of it (scripts found from everywhere). Building blocks: Add ...
Manu Järvinen's user avatar
2 votes
1 answer
630 views

Script to view animation preview panel in fullscreen

Similar to this post: How to make the sequencer 'Preview' area fullscreen with python? I am trying to have my script set the animation preview window to fullscreen without any other panels/...
Jay Marm's user avatar
2 votes
1 answer
1k views

Python script unable to import modules [duplicate]

I'm trying to follow the scripts from the book The Blender Python API by Chris Conlan, and I've been unable to import modules in Python from Blender (2.81) on osx 10.15.2. What file structure / ...
saucewaffle's user avatar
2 votes
1 answer
1k views

How to Update NodeSocketString Value inside a node group in a attribute node using python

I have an Attribute node inside a node group, and for the node group inputs, I have created a NodeSocketString, Using ...
Rakesh choudhary's user avatar
2 votes
2 answers
680 views

how to access Render Result image layers python

My active image in image editor is Render Result image. How do I access the layer via Python (I need it to be set to ...
kemplerart's user avatar
2 votes
1 answer
78 views

frame_change handler called on mouse press and release event when scrubbing

...
Blender Rookie's user avatar
2 votes
1 answer
2k views

Python Stop-Motion Insert Keyframe

I'm creating a stop motion animation that requires to Insert Keyframes of visibility. I was attempting to work out a script to make this process faster for me, but being new to python this has evaded ...
Kyle Martin's user avatar
2 votes
2 answers
7k views

add object at specific location with python?

This might be a really stupid question-I'm working in bpy right now and want to add a plane at a specific location...I know that How to add an object at a specific posistion in Blender Game Engine ...
29374819's user avatar
  • 331
2 votes
1 answer
1k views

Set material strength and keyframes in Cycles with Python

I am making a piano song animation in cycles where in exact places (if a piano button was hit) the piano string lights up (Emission shader Strength = 5) then fades away (so go back to 0 Strength in ...
Alex's user avatar
  • 23
2 votes
1 answer
1k views

How to force the update of a property in python?

I'm writing a function that should return the frame when a field reaches a certain value in the property window. To be more specific here the function: ...
Henri Hebeisen's user avatar
2 votes
1 answer
963 views

How to manipulate position of mask layer using python

I'm using Blender 2.78 and playing around with making different video transition effects. I want to automate the dynamics of a mask layer(rectangle as seen below) and it all work fine if I add ...
Skygge's user avatar
  • 23
2 votes
1 answer
2k views

Getting os.system to work in Python Console?

I do this in the Python Console in Blender 2.64 on Ubuntu 11.04: ...
sdaau's user avatar
  • 413
2 votes
2 answers
673 views

Difference between variable and property scope in a script

My __init__.py script creates a panel that lets a user select the figure (typically a humanoid figure imported from Poser) she wants to give shaders to, defines the ...
RobinsSea's user avatar
  • 253
2 votes
1 answer
2k views

Get the transform matrix for each frame

I'm new to scripting inside blender (two days). I have a camera folowing a path (a circle). I have written the following code to get the location and rotation for each frame and write it to a file: ...
Sunimal S.K Malkakulage's user avatar
2 votes
2 answers
873 views

How to make the sequencer 'Preview' area fullscreen with python?

How do I, with python, select the sequencer area which has a view type as preview, to make it active/context? (And not select the "strip" window) EDIT: My overall goal is to add a windowless, ...
tintwotin's user avatar
  • 2,406
2 votes
0 answers
1k views

Import STL and render image

I am not very familiar with blender, more of a python programmer trying to use blender headless. I want to import an STL to a scene and render an image from different angles. So I botched a code ...
AlonMln's user avatar
  • 121
2 votes
1 answer
1k views

How to make Modifier panel visible in Toolshelve

...
Claas Kuhnen's user avatar
  • 1,727
2 votes
1 answer
204 views

Python script - apply only to selected

Is there a way to tell the script to only apply the changes (moving keyframes in this case) to selected object(s)? Here is the specific code I'm trying to modify: ...
LDCO's user avatar
  • 581
2 votes
1 answer
397 views

Extracting a text string info (character's indices) to use it as a material mask

I think an image can say more than words sometimes... :) The idea is to use a different color from the color ramp for each character in the string. It's related to this question
Bithur's user avatar
  • 8,274
2 votes
1 answer
980 views

Align object to view with Python

I was trying to a add a plane primitive using Blender Python and aligning it to the viewport. I already tried setting align_view = True when adding it via Python, ...
Bert's user avatar
  • 23
2 votes
2 answers
2k views

bpy.data.libraries.write not working?

I want to save selected objects into a separate .blend file in 2.8. https://docs.blender.org/api/blender2.8/bpy.types.BlendDataLibraries.html suggests: ...
morph3us's user avatar
  • 1,449
2 votes
1 answer
3k views

Opening a blender file during python script execution without changing context

During execution of a python script, I'm trying to import a .blend file. It's currently not an option to load the file when Blender boots, although ideally we would get the same result either way. I'm ...
Turiphro's user avatar
  • 161
2 votes
1 answer
2k views

Blender how to periodically reload file (python)

I'm trying to write script that will automatically reload file every few seconds. In order to do that I wrote following plugin: ...
Lapsio's user avatar
  • 153
2 votes
2 answers
1k views

Set object origin to minimum Z (set to floor) (using examples from @TLousky)

I'm working off examples found here: Getting global axis value of the vertex with the lowest value (and other from @georges and @tlousky, many thanks!) I'm working off a csv example and an 'set Z ...
pfraterdeus's user avatar
2 votes
1 answer
834 views

Blender function to transform a selected edge along a custom axis

How blender is Setup: In Blender I have created a triangle and extruded it. Selected an edge and created a new transform in the UI and named it "Edge.001" it is currently active. Now I have selected ...
Aiena's user avatar
  • 160
2 votes
1 answer
2k views

View3D operations problem [duplicate]

Currently i am trying to change the viewport of the 3D View window using a python script. I am using this function bpy.ops.view3d.viewnumpad(type='TOP'); But it ...
BetterEnglish's user avatar
2 votes
2 answers
1k views

Batch Selected to active Baking

I have to bake several objects, in combined type. Each (lowpoly) object take baking information from a selection of another (highpoly) object(s). Here is my bake panel config: My problem is that i ...
Vinc3r's user avatar
  • 548
2 votes
1 answer
898 views

Rendering video sequence editor by scripting

I'm trying to render all individual strips that I have in the video sequence editor in separate files automatically. I started this script: ...
G Viaud's user avatar
  • 145
2 votes
1 answer
1k views

How to define customized property in Material?

I'm working on my addon for Blender, which is a simple offline renderer. I'm stuck at the material system for two days. I would be much appreciated if anyone gives me a pointer. The issue is that in ...
JerryCao1985's user avatar
2 votes
2 answers
10k views

How to set camera location in the scene while pointing towards an object with a fixed distance

I want to position the camera around an object using Blender's Python API. Assuming that an object is centered at (0, 0, 0), I want to move the camera around it ...
Amir's user avatar
  • 3,074
2 votes
0 answers
3k views

Creating a generic IK/FK snap script

I've tried deconstructing the Rigify addon to isolate the script part that handles IK/FK snapping, but so far I've had no luck. Rigify is a very nice tool, but I'd like to get the snap functionality ...
Doccers's user avatar
  • 21
2 votes
1 answer
1k views

How to project back rendered depth maps to recover the ground-truth 3D shape using Blender?

You can discard the images I have uploaded and can simply use some camera angles of your choice to render depth maps of a 3D shape and then fuse the rendered depth maps to recover the underlying 3D ...
Amir's user avatar
  • 3,074
2 votes
2 answers
1k views

move object without changing origin

I have an armature which has its origin at 0,0,0. I want to move the armature so that the lowest zvalue of it's bounding box is placed at 0,0,0 using python as shown below without changing the origin, ...
Tak's user avatar
  • 6,303
2 votes
2 answers
1k views

Encoding Vertex Position into Vertex Colors

I got a model in -1 to 1 space and I want to encode each vertex position into the the vertex color for future use. There seems to be nothing by default to do that so I will have to use a custom script ...
HellGate's user avatar
  • 141
2 votes
1 answer
884 views

frame_change_pre.append(handler) doesn't work

I wanna run a function each frame. So I create a new script and type in the following: ...
Severin Bauer's user avatar
2 votes
1 answer
411 views

constraining object to a triangle plane

I've been looking all over the place and I can't seem to find the right constraint for this. I have a circle that needs to be constrained to a triangles area. Limit Distance Constraint doesn't seem ...
sf8193's user avatar
  • 155
2 votes
2 answers
2k views

Can't get script to auto execute [duplicate]

I am an experienced python programmer, but just getting into the Blender API. I am stuck on trying to get a script to execute when the Blender file is loaded. I want to do all sorts of setup in this ...
datasmith's user avatar
2 votes
1 answer
1k views

Creating a new particle texture using python scripting

How would I create a new texture for a particle system? I tried bpy.ops.texture.new() but that wouldn't create any type of texture.
user avatar
2 votes
1 answer
477 views

Calculate surface by logarithmic function?

Is there any way to use the log() function in order to calculate the surface of a mesh?
Felix SuperSlide's user avatar
2 votes
1 answer
1k views

Using Python, how can I preset points in ShaderNode RGB Curves?

I have referred to https://blenderartists.org/t/how-to-modify-rgb-curve-nodes-in-compositor/503936 hoping the technique would be same or similar for shader nodes. I have also checked Is there a way ...
Fibon3's user avatar
  • 59
2 votes
1 answer
350 views

Render subsection of frame

I'm hoping to be able to render frames of an animation where I render slices that are set to different points in the animation. This effect could easily be achieved in after effects but the render ...
akupresanin's user avatar
2 votes
1 answer
3k views

How to execute an operator from an EnumProperty?

I have a simple EnumProperty with let's say two buttons. Now i want to create a primitive with one of the buttons. But a click at the button does nothing. There is a bit missing. The operator needs to ...
Tiles's user avatar
  • 2,028
2 votes
1 answer
850 views

What is the space used by Scene.ray_cast()?

This is the complete 2.8 documentation for Scene.ray_cast ray_cast (view_layer, origin, direction, distance=1.70141e+38) Cast a ray onto in object space ...
Robin Betts's user avatar
  • 76.5k

1
18 19
20
21 22
26