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

Able to change dimensions, but not scale

I am new to scripting in Blender and I have a set of commands that work to create my object when pasted into the command line, but not when run as a script. The first major issue I've run into is that ...
0
votes
1answer
17 views

Ununderstandable Syntax Error

I'm working on a script that essentially build strings to write datas in an external file. All my code worked fine untill today and I really don't understand what's going wrong. Blender gives me a ...
0
votes
1answer
14 views

Set transform of a child object to an arbitrary point using a script

I've been working on a script to assign transforms to child objects, such that the transforms will be transferred to Unity ( relative to the origin set in Blender, along with their rotation ) when ...
0
votes
0answers
7 views

How can I make a button in a panel that runs a custom script that I have already written [duplicate]

I have written a few scripts, some are over 8000+ lines. How would I put these in a tab and link a button to those scripts. All I could find on the internet was how to run basic stuff like put down ...
0
votes
0answers
21 views

Help with export button (exporting fbx)

Im in need of some python help or someone with more knowlage with python, tryn to update an old 2.7 scrip to 2.8 and so far so good until clicking on export button. i get this error when using a ...
0
votes
2answers
16 views

Exporting object's rigid body sim XYZ coordinates

I created a simulation of falling apples into a box. For research purposes, I want to be able to export the XYZ Coordinates of all apples (center of mass of objects, if possible) into a dataset, only ...
0
votes
1answer
23 views

Print to Info or grey out a button if no object is selected - Python script

How would you print to the info if no object is selected (no active object), or grey out the buttons for a script that is operating on a mesh object? I understand you could run a ...
1
vote
0answers
12 views

Why isnt my code not creating keyframes to all the active objects?

So im facing issue with my python code which is as follows. ...
2
votes
1answer
36 views

What is the bmesh equivalent to bpy.ops.mesh.shortest_path_select()?

Basically I am trying to replace a call to bpy.ops.mesh.shortest_path_select() in an Add-on of mine. While many bpy.ops.mesh ...
2
votes
1answer
31 views

What is the correct 'data_path' to animate the colour of a Principled BSDF node with Python?

Version: 2.83 I want to change the colour of a material during animation - via python script. I can create a cube wherever I want, called myobject and attached to ...
0
votes
0answers
14 views

Scripting a propeller or gear ; the info window python code fails to match success of GUI duplicate and rotate applied to master gear or blade

Given the master propeller blade or gear already drawn at the desired radius from the rotation axis, the Blender GUI approach to duplicate the original and x-rotate the copy 15-deg is to type shift+D ...
0
votes
0answers
21 views

Why does 'bpy.context.object' return 'None' when accessed by an operator in a panel?

I wanted to switch between Display modes with hot keys. And I decided to write my own operator for this and create a small add-on to be able to start using hot keys and switch between these modes. The ...
0
votes
0answers
11 views

How do we duplicate and rotate multiple copies, as when modeling an aircraft propeller, given the template blade [duplicate]

I tried this, given the template propeller blade mesh already drawn, but see no copies: ...
0
votes
1answer
12 views

how to apply a boolean modifier to a collection

how to apply a boolean modifier to a collection instead an objects?
0
votes
0answers
17 views

Blender 2.8 Python Scripting Pie menus and Side operator panels

I am creating a Pie menu layout for my addon and having issues with the location of menus. They seem to land on top of where the pie operators are. Ideally I would like menu panels on both sides of my ...
0
votes
0answers
5 views

Python - Get/Set active hair particle keys

Is there any way to get and set selected hair keys in Blender 2.8 and later? Getting and manipulating the coordinates is easy but that's not what I need; I'm trying to create an operator to select ...
0
votes
0answers
18 views

Python Script for selecting a Row of Vertices and applying 'Sort Elements'?

I have a number of Tiles resembling a Sphere. In each tile, the Vertices are arranged in a different order, I want to rearrange them in a uniform order, like this, So, the way I've been doing this ...
0
votes
0answers
10 views

How can I import a text file of frames and shape IDs (from Adobe Character Animator) and auto apply them to matching shape keys in Blender?

I'm trying to take lipsync info generate by Adobe Character Animator and apply it to shape keys in Blender. Adobe Character Animator will let me copy its generated lipsync information from the ...
1
vote
0answers
8 views

How to search for files in Sequencer by format, through my Custom Node?

I am creating a Custom Node that handles Audio. I want to get the list of all Sound Strips (Files) that has been already added to the Video Sequencer. I want to create an Input that when you click ...
2
votes
2answers
63 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 ...
0
votes
0answers
17 views
0
votes
1answer
19 views

Multiple similar functions mapped to one hotkey?

First time posting to these forums. I am in the process of trying to learn Blender having come from a Max, then Maya centric workflow. I was wondering how difficult it would be to map a series of ...
0
votes
1answer
23 views

How to move objects via script so that they stay in camera view

Ok, I am completely new at scripting in blender but I wanted to know if there is a way to move an object within a scene randomly (x,y,z) but constrain its movement to only the camera view. In other ...
0
votes
0answers
26 views

Changing Elevations on a Slab [closed]

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
1answer
29 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
15 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
25 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
9 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
38 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
11 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
22 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
19 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
17 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
57 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
20 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
38 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
21 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
10 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
25 views

Not created again already exists material

I have a such a code ...
0
votes
0answers
22 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
19 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
17 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
21 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
19 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
26 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
29 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
17 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
21 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 ...

1
2 3 4 5
86