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
0answers
8 views

glReadPixels can not get float value

I am totally new to blender and I am trying to read the float value color from the buffer. But it seems that glReadPixels value can not return the float value with even two decimal digits of precision ...
0
votes
0answers
19 views

How to rotate a spotlight using script?

I have been starting to use blender , avoiding the GUI almost entirely and doing only scripting. To do the lighting I have been using: ...
0
votes
0answers
10 views

Is there a way to print pixel coordinates/RGBAcolor for each object from render result?

Is there a way to print pixel coordinates/RGBAcolor for each object from render result? If yes, then how to? I want to print pixel coordinates of every object in render result
0
votes
1answer
15 views

EXCEPTION_ACCESS_VIOLATION when trying to bpy.ops.scene.new(type='LINK_COPY')

I am actually trying to open a blend file from a script and I have to make a copy of the scene so that I can make some modifications in the new scene. However, after I run ...
1
vote
0answers
10 views

How can I rotate 'LOCAL' orientation in 2.82 python Script

Blender : 2.82 Windows 10 This is my code and i want to rotate 'Global' and 'Local' both ...
0
votes
0answers
10 views

How to play multiple actions using action actuator?

There is some actions that i created for a human character like walk, jump and saying bye. I want to play these actions one after one using action actuators or any other way. I mean if i want to play ...
1
vote
0answers
31 views

Is possible use multiprocessing for joining objects in python?

I strongly suggest not to try this code as it will open a number of blender windows out of proportion. This is an example for illustrative purposes of what I would like to understand, that is if it is ...
0
votes
0answers
14 views

Custom property for Area

For what type of bpy.types do I need to add my custom property to have it for any window Area or Region? I tried bpy.types.Area,...
0
votes
0answers
18 views

Automated batch rendering script for STL files [closed]

I want to automatically render many STL files. Requirements: Loading files from a folder Automatic positioning of the camera to fit each part Automatic lightning setup (it might be possible to do ...
0
votes
2answers
26 views

Blender UI panel custom property doesn't show up

I am currently learning how to create addons in Blender and now I got a problem. I try to create an addon which creates x times a math node. But when I try to create an IntProperty, it doesn't show ...
0
votes
0answers
9 views

How can I set abc path file?

How can I set abc path file by script? I have only this until now: bpy.context.scene.objects.active = ob bpy.data.cache_files["test.abc"].filepath
0
votes
0answers
16 views

Import Lightwave Object LWO

I'm new in Blender, but close to 20 years of experience with Lightwave. I had read that you can enable LWO import in Edit > Preferences > Add-ons, but there's no Lightwave import option there. I ...
0
votes
0answers
21 views

Float values in image pixel have different precision to set value

I am trying to set float value to pixels in an image. But the value as shown after that is different from the value that has been set. It seems this is a precision problem as mention in this answer. ...
3
votes
1answer
139 views

Create a Collection inside another Collection with python

How to create a Collection inside another existing Collection with Python?
1
vote
1answer
52 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: ...
0
votes
0answers
21 views

How do I convert camera coordinates to world coordinates?

Blender has a great function to convert world coordinates to camera coordinates. However, in my case I am trying to do the exact opposite and can't find an existing method of doing so. I have tried ...
1
vote
1answer
47 views

How do I calculate how far an object has travelled in a specific time?

I can't find any reference to calculate an object travelled distance along a time range. I think it could be done by using Matrix difference from frame to frame. I need distance travelled on each ...
0
votes
0answers
11 views

Get object orientation in bone space in python

I need to get the orientation of an object in a world space from the bone space. How to to do it in python.
0
votes
1answer
68 views

How to output multiple images from Blender's compositor with Python?

I know how to render one image via Python and get an output with Blender's compositor. What if I need it to render 100 images for me with numerical names e.g: img_1...
0
votes
0answers
20 views

is it possible to loop through all objects in edit mode

I've trying to use python to select all objects in a scene & apply mark freestyle edges but I'm getting this error: TypeError: Converting py args to operator properties: enum "EDIT" not ...
1
vote
0answers
28 views

How to create a collection of (thousand of) spheres with each sphere at a specific set of xyz coordinate?

I have a xyz file containing coordinates of spheres. My goal is to draw something like Figure 2.2 in this link: http://www.fgarciasanchez.es/thesisrocio/node21.html On this forum I found a script ...
0
votes
1answer
13 views

Getting interstitial compositor frames when using frame step

I'm trying for a really jittery stop-motion like effect by using frame step to render on the twos (or threes, or fours). Rendering this normally and getting a video file out makes the frames happen at ...
0
votes
0answers
17 views

Trying to create my first script, looking for guidance

I am trying to create a script in Blender to optimize a project, but as I have never created a script in Blender, I need some guidance. What I want to do is select a number of objects, (a few ...
0
votes
0answers
10 views

Blender 2.8 bpy.utils.unregister_class Not Working [duplicate]

I'm using Blender 2.8; the bpy.utils.unregister_class function throws the same error (bpy.utils.register_class works fine). For example, the ui_panel_simple.py template: ...
0
votes
0answers
13 views

How can I get the position of a given mesh and add a vertex there via script in 2.8?

I need to pick the origins of multiple objects and draw edges going from one to another. I have to automatize it somehow. If I can get the vertices in an array I could use pydata to draw the mesh but ...
0
votes
1answer
23 views

script, Iterate objects and remove doubles [duplicate]

I have a very basic understanding on python and I would like to create a quick script that will iterate all the objects in the scene, remove doubles and than hide the object, But i am having ...
1
vote
0answers
17 views

using phong_ramp as a factor?

i found that in OSL there is a shader called phong_ramp that creates a color a ramp depending on the amount of light that a surface gets. is there a way to use that phong_ramp as a factor output? or ...
0
votes
0answers
28 views

Why do Blender objects have one ShapeKey each?

I am using Maya and Maya has BlendShape. Maya's BlendShape is almost the same as Blender's ShapeKey. And, Maya's BlendShape can transform multiple objects with one node. However, Blender's ShapeKey ...
0
votes
0answers
16 views

Is there a way to silence bpy.ops.render.render(write_still=True)?

The function call prints messages to the console like: Saved: 'Pathname.png' Time: 00:02.48 (Saving: 00:00.35) and I have some programs that output many images, ...
0
votes
0answers
16 views

update every frame with different pydata

I'm constructing a line in python which connects points. A few things happen over time : the points change positions extra points are added inbetween each other at irregular intervals To make ...
0
votes
0answers
15 views

Find object to which an action is applied

I am trying to implement EXT_property_animation for a glTF 2.0 exporter. In glTF, an animation contains several channels and several samplers. The samplers are basically the fcurves. The channels map ...
0
votes
0answers
9 views

How do I make Blender re-read a class variable on execute?

I'm having issues with one of my first, very simple, Blender scripts. In short - in my custom Operator class I save the current Transform Orientation (Global, Local or whatever) into a class variable. ...
1
vote
0answers
52 views

Is there any way to extract child models from 3d model binary file with python

I'm gonna Update my Question. I have the models of an old game that are serialised in to binary files.Game serialised bunch of SO1 files from the source code into single binary file to make a ...
2
votes
2answers
53 views

Script Randomly crashes Blender

I need to automate the process of joining similar objects from an imported .IFC file from Revit, this can take quite long time to sort out manually because this files can contain from 600 to 800 ...
0
votes
0answers
9 views

For Blender 2.80 API bpy.ops.objects.transform yields RunTimeError: Font's can only have scale applied

I am converting my Blender 2.79 CSV Importer plug-in to a Blender 2.80 plug-in, but I stumbled upon an error regarding the transformation of some text labels, which I'm not sure how to solve. In ...
0
votes
0answers
15 views

For Blender 2.80 API, What replaces the constraint_orientation parameter in bpy.ops.transform?

I am trying to update my plug-in from Blender 2.79 code. I am getting the following error from Blender: ...
2
votes
1answer
23 views

Passing float texture to fragment shader returns incorrect value in Blender 2.8

I am trying to pass image texture to fragment shader and read it back. But it only works if the color of the pixel is set to 0.0 or 1.0. The value returns to the buffer if the value is set to, for ...
0
votes
0answers
14 views

Custom python scripts in installation only updates when restarting blender

I'm having a lot of fun creating my own python package for blender. But I have to restart blender every time i edit the packages for it to force reload. I have searched without luck on how to force ...
0
votes
0answers
12 views

How to Use Curve Extrude operation from Curve Properties ->Geometry-> Extrude in a script. (extruding SVG curve)

I am trying to build a script that will allow me to introduce the Curve, Properties, Geometry, Extrude function in a Panel. I need it to extrude and SVG curve. I am trying to use a method similar to ...
0
votes
1answer
24 views

Set light color from python script

I would like to specify the color of a light that I add using a python script launched from the command line: blender --python script.py The script: ...
2
votes
3answers
80 views

How to merge external images together in script?

I'm trying to merge set of images together with script in Blender 2.8. At the moment there is no library like PIL available in Blender, but there is imbuf which one I can use to read the images from ...
1
vote
0answers
36 views

getting realistic renders with script

I'm new to blender and am trying to script for automatic scene generation. I have the following script which I've cobbled together after several days of fooling with examples seen here and there . ...
1
vote
1answer
11 views

Why is the string property added to f-curve read-only

When I create a string property for the object type, I can modify that property in the active object. But when I create another string property for the f-curve type, it said it is read-only. The ...
1
vote
0answers
19 views

Dynamically rotate this cube by passing serial data?

I aim at making an external controller for my blender application. I wish I could rotate dynamically a cube, using post-treated serial data. This code returns correctly the 2 euler angles computed ...
0
votes
0answers
8 views

Best way to handle multiple extensions on export

I am creating a script that can export the position of nodes during a set of keyframes for importing into a game. Thing is though there are multiple file extensions that the program can take that ...
1
vote
1answer
34 views

how to create a Pop up dialog and link the property to an object

I am still really new to Python and I am working through some new things. I would like to create a Pop up dialog box that the user can input some text. I would like to then use that Text for something ...
1
vote
1answer
22 views

Warning from custom panel unable to get Python class for RNA struct ''

First time posting here so excuse me if there is an issue with this question. I have been writing a custom UI addon for blender I have taken out the majority of the code and hopefully kept it as ...
2
votes
0answers
12 views

How to bundle undo steps in Modal operator

Background info: I am creating an addon with an 'Editor' mode. The mode is initiated by an Operator, and while the Modal is running, the user can add/remove/edit objects in the scene. The modal ends ...
0
votes
0answers
20 views

Compute light_direction in Solid mode

I'm trying to compute the light_direction (from the blender API doc) in the Solid mode so the shadow (in the viewport shading options) will follow the direction of a light using it's rotation euler, ...
0
votes
0answers
16 views

Is it possible to have a script running across multiple frames?

I am trying to do a script that would change viewport orientation, do a box selection for vertices/faces, then change the viewport orientation, and do another selection from another angle and so on. ...

1 2 3 4 5 76