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
16 views

Changing Elevations on a Slab

I am new in using blender 2.83. I have created a slab. (I used a Cube and subdivided it). It is 10x20x1'. I know i can edit each vertex (elevation Z) separate (1'). However it takes a lot of time to ...
2
votes
0answers
13 views

Why blender froze when I use Arduino to control the object by using pyserial

I saw a tutorial on Youtube, and I almost did the same process. Youtube link: But in the end, I found my blender froze when I run the script. I'm new in blender and python, so I can't tell what's went ...
2
votes
1answer
23 views

Same Material with different key frames

Is it possible to have same (single) material object applied to different objects (mesh or curves) but have different key frames for each (mesh or curve)? I want to fade-in my text (which is curve) ...
0
votes
0answers
11 views

Renaming renders in scripts

I've generated a basic code to create a bunch of cameras and point them to my object but now i'm struggling with generating the renders. My idea was to generate one render at a time while the cameras ...
0
votes
0answers
11 views

How to create custom editors with Python?

In some addons, for example Animation Nodes, there is a custom editors which is not in default Blender. How could i use scripting to create a custom editor?
0
votes
0answers
7 views

I want a setting in preferences to change when I go into sculpt mode

This is my first python project in blender so I am still new. Basically I want "emulate 2 button mouse" (in preferences>input) to be turned on when I'm in sculpt mode and turned off when ...
0
votes
1answer
32 views

How to add playing videos to the 3d viewport?

Is it possible to add videos to the 3d viewport? I want to add multiple ones playing in a loop.
1
vote
0answers
10 views

How to duplicate a scene ('FULL_COPY') in Python without ops?

I need to create a full copy of the current scene using Python then rename it, I've tried using: bpy.ops.scene.new(type= 'FULL_COPY') But for some reason it gives ...
2
votes
0answers
16 views

How can I add an image sequence in the compositor with Python?

How can we use python to add images as a sequence into the compositor. I am trying to add a transparent graph onto every frame of the render I have successfully done this on the blender itself, but my ...
1
vote
1answer
16 views

Insert keyframe to object's Offset Factor Python API

I am trying to insert a keyframe at an object's "Follow Path" constraint programmatically. More specifically I am trying to insert a keyframe to the "Offset Factor" property of the ...
1
vote
1answer
13 views

Blender 2.8 Text Editor OSL Script Node Update Disabled

I found out what Open Shading Language was today and was excited to try it out, and it was working at first. But at some point, I found that I could no longer press the "Script Node Update" ...
2
votes
1answer
34 views

What is the replacement of 'scene.render.layers['RenderLayer']' in blender 2.8?

It seems that the property scene.render.layers['RenderLayer'] is no longer available in blender-2.8. I just want to set the ...
0
votes
0answers
9 views
0
votes
0answers
17 views

Update ANT Landscape with script in render

I'm completely new to Blender and I'm toying around with landscapes and scripting. I want to animate the Noise Size of the generated landscape for each new frame. I keyframed the value of the Noise ...
0
votes
0answers
38 views

Trying to draw a specific curve with Python

I am an amateur and beginner using Blender 2.82a on my Windows PC (nothing fancy). I am trying to make a 3D animation of some pipes, but I am stuck at even the very beginning. I am extremely bad at ...
3
votes
1answer
36 views

What is it called when you type math directly into a property?

In After Effects we call it expressions or action scripting. In c4d we use Xpresso or in the old days C.O.F.F.E.E. What is it commonly referred to in blender when you just want to do something similar ...
1
vote
1answer
20 views

Addon object using PropertyGroup object attribute

I'm working on adaptation some addon from 2.79 to 2.8x. It uses property groups to fill other objects with recurring attributes. ...
0
votes
0answers
8 views

Is there a way to create a preview window in a panel/popup to show the compositor result with Python?

Is there a way to create a preview window in a panel/popup and show the “Render Result”? Would like to show updates when changes made in the compositor.
0
votes
1answer
24 views

Not created again already exists material

I have a such a code ...
0
votes
0answers
15 views

How can I check whether the Principled BSDF has texture maps connected to it with Python?

I am trying to script a simple exporter that would help me get material data to a webGL engine from Blender 2.8. I am able to get default values of roughness, metallic and transparency. For now this ...
0
votes
0answers
18 views

Addon not appearing after installing

I have an addon I'd like to install. I get a blue message at the bottom saying that the addon has been placed in the addons file location next to where Blender was downloaded... But when I go to ...
1
vote
0answers
16 views

obj to glTF batch exporter

I have a set of obj exports comprising of a million files(each file between 100-200kb). Is there are a way to pick up files from a folder and export them to glTF? What I am talking about is batch ...
0
votes
0answers
19 views

script mathematical mesh with xyz function surface, each coordinate parametric with u,v

Circa 2015, in the python script window we could enter: ...
0
votes
0answers
18 views

How to count items in the same objects?

I have 1 objects, and inside that a cube and a cylinder. How to extract the number of items from this objects? See here:
2
votes
1answer
19 views

Python script - objects are grey after export to glb file

There is my short code. I'm using blender_osm addon to generate these buildings. After the first render, it looks fine with colors on textures. But when I export it and reopen all textures are grey. ...
0
votes
0answers
10 views

poll with select_get gets no attribute error

I was trying to make the addon button only available when object is selected. However the Error says: NoneType object has no attribute 'select_get' The code as ...
0
votes
1answer
27 views

Why can't I display an EnumProperty in a UIList?

Actually, I know how to "insert" or "add" custom properties into a UIList in blender 2.8. But actually I'm stuck with enum and collection properties. I don't know why I can't ...
0
votes
0answers
13 views

Making a button active when clicking another button with Python?

Let's say that I have a panel with two buttons. One o them is inactive/gray out. By pressing the second button I want to make the gray one clickable. Can I do this from the Main Panel?
0
votes
0answers
20 views

How to modify curves and make object to follow path using Python scripting

I want to create x number of BezierCurves and manipulate them so that the objects which follow their path do not seems colliding with each other when playing animation. So, basically, I have some ...
0
votes
1answer
19 views

How to deselect origin center/ cursor blender with python?

Is there any method to deselect origin center/yellow dot, or make it inactive?
0
votes
0answers
38 views

Can not move polygons but only vertices of an object by bmesh!

I can only move the vertices of the monkey to (2,4,6) but not by polygons and effects look strange. What is the right way to calculate the polygons by the vertices according to their Z value? ...
2
votes
0answers
26 views

How to create a hook modifier on every point of a curve using python

I made a script to add a hook modifier on every point of a curve using a for loop but I get an error in 2nd iteration. Below is the code: ...
1
vote
1answer
16 views

How to register scripts in the startup/scripts folder if they are inside a Sub-folder?

I know I can place a script in Blender's startup/scripts folder and it will register when you open Blender, which is what I normally do. However, I have a lot of scripts so I tried putting them in a ...
1
vote
0answers
10 views

How get mouse position for a custom selection script in Blender 2.8/2.9? [closed]

I`m trying to make script that selects objects with the same property. Operator "bpy.ops.view3d.select" selects only in the zero position (0,0), and function "event.mouse_x" ...
2
votes
1answer
98 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 ...
0
votes
0answers
35 views

How to move the polygons of an object into other location by bmesh frame by frame? [duplicate]

How to move the polygons of an object into other location by bmesh frame by frame? I tried below way but failed. Is it possible to generate polygon movement animation effects like in Animation Nodes ...
1
vote
2answers
21 views

How can you set Blender's Theme Preset with python

How can you set Blender's Theme Preset with python? I'm don't mean customize a few colors, I'm talking about loading one of the existing presets. Is there a simple command I can run?
1
vote
0answers
20 views

Is there a list of the different ui options I can use when making an add on?

I’m making an addon and was wondering if there’s a list of ui properties. I couldnt find any in the documentation. Are the only available ones float, int and str?
3
votes
1answer
17 views

How to access the Kemap settings Preferences (Spacebar Action, Select Mouse button, etc) with python?

I use a python script to set up some startup preferences like this: bpy.context.preferences.view.show_tooltips_python = True However, there is a particular set of preferences I don't know how to ...
2
votes
1answer
35 views

How can I add a collection using Python?

I'm new to Blender. Tutorial information as recent as January this year appears to be out of date and I can't figure out how to create a new collection and add an object to it. The most recent ...
2
votes
1answer
37 views

How can I store the name of selected objects in a text file?

I would like to create an automatic list of the objects that have been selected with the mouse click. So for example I have cube1, cube2, cube3, cube4. I select them in the following order cube3, ...
0
votes
0answers
10 views

Can I access the .blend file path during the first execution of bpy.app.handlers.save_pre()?

Here’s some context: My addon allows users to import several files, but the data would be referenced rather than saved as part of the .blend file. So I need to store the path to the imported file. I ...
2
votes
0answers
32 views

How to re-register a built-in operator?

An existing operator can be overridden by assigning bl_idname of an existing operator to a new one. This can be used to extend and even limit the functionality of ...
1
vote
1answer
27 views

fake_module: addon missing 'bl_info' gives bad performance!:

I tried to make a multiple file add-on using _ init _.py file I have two files from which I am trying to import operator and panel first file is material_operator.py in which I have defined an ...
0
votes
0answers
19 views

Create a custom object type to constrain options of blender object

I am working on adding a particle system exporter for a custom glTF extension. That glTF particle system is not as complete as the Blender one and even some options look very complicate to match. I ...
0
votes
0answers
6 views

How to add Shift+another key as a shortcut in a modal operator?

Made a simple modal operator to perform symmetry, and I would like to add Shift+X to perform symmetry from the Negative X axis. But I can't figure out how to do it and all the info I found in other ...
2
votes
0answers
14 views

Change Background Picture with scripting

i tried to change the background of my blender scene in a python script. I changed the background manually. These were the following commands in console: ...
0
votes
0answers
13 views

Convert an mesh object and its material to byte array

I tried bytearray(bpy.context.object) and byte(bpy.context.object) and I get ...
0
votes
0answers
18 views

OSM automate texturing building roofs with satellite image

I am following CG Geek's tutorial on how to use blender-osm to create a city in blender (https://www.youtube.com/watch?v=NW_djQS_N8U). He saves the satellite overlay image, then splits the building ...
0
votes
0answers
8 views

add a model generated by GPU python module to Scene Collection

I tried to run a few of the examples provided for the python API GPU Shader Module (https://docs.blender.org/api/current/gpu.html). I noticed that the objects are added to the Viewport but i do not ...

1
2 3 4 5
86