The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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

How to insert keyframe_insert without moving the object

I tried the following code: ...
0
votes
0answers
13 views

Create new Anisotropic BDSF material using script

I want to create new Anisotropic BDSF material using script. How can I change the surface of the material using script?
0
votes
2answers
17 views

How to make the UI interractive to it's size?

in this little addon i try to make an asset management system. I'd like that the number of assets per row are adapting in real time to the size.x of the window or maybe the other way around: the size ...
0
votes
0answers
13 views

Different lighting between saved render image and CompositorNodeViewer image data?

I am following this blog post for testing out rendering possibly without writing to a file: https://ammous88.wordpress.com/2015/01/16/blender-access-render-results-pixels-directly-from-python-2/ I've ...
0
votes
1answer
16 views

How can I calculate global coordinates for GPencilStrokePoint in Blender 2.8 and Python?

I have already tried by calculating: point_global_co = grease_pencil_object.matrix_world @ point.co But it gives very odd results.
0
votes
0answers
15 views

How do I get a custom panel to redraw its content without having to close and re-open it?

I have to show the state of a programmable logical controller (PLC). PLCs can have different states like "RUN", "STOP", "CONFIG" etc., and I want to show this state with an icon in a custom panel. I ...
0
votes
1answer
12 views

How to access and edit Mapping Node via python?

I need to access Mapping Node via python to edit Location\Rotation\Scale ...
0
votes
1answer
25 views

How to draw a node group in a layout panel using python

I just made that node group and i just wanted that this node group should appear in Properties panel in 3d view which appears when 'N' Key is Pressed this should look like this in materials tab can ...
0
votes
0answers
18 views

Render scene using multiple GPUS

Are any script adjustments needed to render a scene using multiple GPUs or bpy.data.scenes[0].cycles.device = 'GPU' selects automatically all the available GPUs
-1
votes
0answers
19 views

Add-On Dev: Different Memory Address of Operator Instance

This is a pretty obscure question, and I have no idea if this is Blender specific or not, but can anyone help me understand what this means: Within the __init__() ...
0
votes
1answer
35 views

Blender scripts not showing in Blender

Started using Blender yesterday (Blender 2.8 on windows 10 system) and created two small blender scripts. Today I opened blender and the texteditor and I wanted to open a previously made blender ...
0
votes
1answer
12 views

blender 2.8 how duplicate view3d area into new window from script

Is there a way to duplicate view3d area into a new window from a script? This is how it's done through the UI: blender docs. I want to have a separate window with only the 3d viewport. found this ...
0
votes
0answers
14 views

Python: How to pan and scale GizmoGroup with background

I have coded a custom GizmoGroup to manipulate the effects strip in the VSE visually. It works in principle, but unfortunately I can't line up the gizmo with the picture, because the gizmo ignores any ...
0
votes
0answers
14 views

How would I make a pluggin to toggle subd surfaces on and off and add the sub modifier to the stack? [duplicate]

I was wondering how I would be able to script a plugin that would toggle subd surfaces preview if it has a sudb modifier on. It would also be helpful that if the selected object doesn't have a subd ...
1
vote
0answers
20 views

sending Data or Values to linked Objects in Blender 2.80 / 2.81

I work a lot with linked data and library objects or linked collections. Is it possible to send values or variables between the different hierachical structures ? So for example: SCENEFILE (var = ...
0
votes
1answer
18 views

Timer that can interact with context.object?

i'd like to create a timer that can interract with the active object. every time the active object is not the same as the object in my pointer prop it automatically replace pointer object with the ...
6
votes
1answer
149 views

prevent add-on being enabled in lower Blender version than 2.8

is there a canonical solution to this? I'm one of the developers of Sverchok and we are more frequently getting installation issues where people install the 2.79 version of Sverchok on Blender 2.8+. ...
0
votes
0answers
28 views

Blender 2.8 create mesh via script

I need to create a mesh by reading a custom file format. I have a list of vertices, faces and uvs. So far I am able to create a mesh with vertices and faces with the following script: ...
0
votes
0answers
48 views

Blender script render

I am trying to programmatically generate and render a Blender scene with blender --background --python foo.py. The rendered image and the reference image is ...
0
votes
1answer
17 views

Processing when ModalOperator has already been executed

I want to make an add-on using the Timer of ModalOperator. I want to prevent the same ModalOperator from running if the ModalOperator was already running. What should I do now? https://github.com/...
0
votes
1answer
25 views

Add-On Dev: Button that simply calls a Function?

I apologize for the volume of questions. I tried searching for this, but came up with nothing related. When building an operator window (or panel for that matter), is there any way to setup a simple ...
0
votes
1answer
16 views

Error when activating add-on

I made the following add-on by the test and tried it with Blender2.8. ...
0
votes
1answer
18 views

Add-On Dev: Operator Window - Open/Close events?

I've read in several places that its not safe to rely on constructors for types derived from Blender objects, such as property groups. But now I am creating a pop-up window with an operator class (...
0
votes
0answers
19 views

Simple Python script not moving objects away from center

Warning: I am a complete noob at Python Scripting :P What I want to achieve is that all of the selected objects are moved away from the center randomly, so I have created a simple script that (should)...
0
votes
0answers
13 views

How to draw inputs from node group in layout panel

How can I access the node group input sliders in layout panel my test script is this ...
0
votes
1answer
23 views

Reset Blender scene to default state

I have a script that generates scenes after each iteration is completed I delete all the mesh properties but still not all the data has been deleted. Is there any convenient way to reset blender ...
0
votes
0answers
12 views

Setting a custom UI that controls an object’s appearance?

Blender Python (overall Python) noob here. I’ve got my UI setup but how do I make my custom enumproperty change the mix node’s factor to change the objects’ color. Also, how do I show/hide objects ...
1
vote
2answers
24 views

Add shortkey for Reload Scripts in Blender 2.80

Blender 2.7x used to have F8 as the key to reload the scripts. As an add-on developer I rely on reloading the scripts a lot and having to press F3 and search for "Reload Script” every time i update ...
1
vote
1answer
20 views

Python: Create GizmoGroup for VSE (Video Sequence Editor)

I am currently trying to create a gizmo for the transform effect in Blender's VSE (2.8). However, I can't seem to get it to work. In fact, even though I call window_manager.gizmo_group_type_ensure() ...
0
votes
0answers
13 views

Add-On Dev: Non-property members for Blender classes

I just learned a very crucial Python concept that is very easy to miss when you blissfully learn things on your own instead of reading instructive material (like an intelligent person): That variables ...
0
votes
0answers
18 views

Retrieve Ray Tracer data

I need to be able to, given a scene in Cycles, extract the values of direct lighting intensity and angle of incidence for every light ray that hits a mesh. The final goal is to use these values to ...
0
votes
0answers
14 views

When print () is executed in ModalOperator, where is it printed? [duplicate]

I executed print ("test") with Blender's PythonConsle. print("test") Then "test" was printed in the Console as shown in the image below. However, I wrote code ...
3
votes
2answers
95 views

how to display an image in blender UI with python?

is it possible to display an image within the blender UI interface ? let say that i want to display a 500x500px image in the N panel in layout.box().column(), how ...
0
votes
0answers
18 views

Can i select “extra edges” in ngon by script or special command in blender?

I have a problem. Maybe somebody can help me. I want select man on plane after knife projection without these "extra edges by script or one command". 1) Can i select "extra edges" in ngon by script ...
0
votes
1answer
28 views

How to get around bpy.ops.object.material_slot_assign ()?

Faced with a problem that causes crash Blender 2.80. For automation I created a script from a sequence of actions which works great if I run it in the blender console window, or if i Run Script in a ...
1
vote
1answer
24 views

Difference between played and rendered animation

I face a really odd thing When rendering a scene the output AVI file is very different from the animation I see inside blender. The script is looping over a function which create the scene: ...
1
vote
0answers
20 views

gbl shader blender 2.8

After adding an draw handler to my operator my terminal is showing the following: ...
0
votes
0answers
18 views

How to Draw a Spiral curve Using python script?

How can I draw or access the Already Present Spiral Curves in Curves Menu through Python script? can anyone help me ?
-1
votes
0answers
28 views

Add-On Dev: Generate Properties Procedurally? [duplicate]

Is there a way to define a property group through code execution? All of the properties added to it will be of BoolProperty() type (if that makes any difference). ...
1
vote
1answer
32 views

How to get the meshes name from the object name

In Blender, object names and meshes names may be different, as in Cube2 and Cube.001. Is there a way to get the meshes name from the object name using Python? Also,Is there only one meshes node per ...
-1
votes
0answers
26 views

How to override “editmode_toggle” or “mode_set” in blender 2.8

im kind of stuck in my script. i'd like to automatically go in edit mode of object defined X while any other object could be in selection inside of my timer. so here's what i did below. i still have ...
0
votes
1answer
18 views

Difference between instance object and object in dependency graph

I started scripting in Blender not long ago. Even though I have read the API about the dependency graph I still have a question: What is the difference between an ...
0
votes
1answer
21 views

Error baking rigid bodies before rendering

I'm using the following function to render my scene: ...
0
votes
2answers
33 views

Run python file in blender from command line

I have the following structure: The repo folder is located over ~/Desktop/Github/ and when I run from the command line ...
0
votes
0answers
13 views

Add-On Dev: Checkbox for flags?

I like that we can use toggle=True inside of layout.prop() to convert a boolean checkbox into a button toggle. And I know we can ...
0
votes
1answer
13 views

Blender Collada IO Script location

I want to change some presets for the DAE Import/Export, but for the hell of it I'm not able to find the locations of wm.collada_import and wm.collada_export. If anyone could be of quick help I'd ...
0
votes
1answer
18 views

Is it possible to deselect vertices in Python?

I have an existing selection which I'd like to further isolate using Python scripting. In this instance the math is simply that if the X coordinate is greater than zero, it should be deselected. I ...
1
vote
0answers
14 views

Add-On Dev: Attaching data to scene objects without Blender properties [duplicate]

I just found out that it's possible to attach variables to scene objects without using Blender property types. For example.. bpy.data.scenes[0]["MyData"] = MyData ...
0
votes
0answers
28 views

Add-On Dev: Default of PointerProperty changes based on type?

I'm trying to make sense of something I've noticed while debugging. When I add a property of bpy.props.PointerProperty with ...
0
votes
0answers
6 views

BGL Draw an outline from a circle & have it update when the circle moves?

I have very limited knowledge on bgl & gpu shaders for 2.8 I'd like to draw a blue outline on a circle, in object and edit mode. Does anyone know any examples out there?