Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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).

0
votes
0answers
6 views

Way to controll particle hair objects without weight paint on mesh

Not find on internet this question : Want to make distance from boundaty of face and distance between the particles. I want a faster way than using painting at all times. is there a set for this? or ...
0
votes
1answer
7 views

How to get back to scene view after opening python console?

So, I'm very new to blender. I am trying to do a batch scripting project for a friend, so I'm just trying to learn the scripting/console environment. I already know python pretty well. I found out ...
0
votes
1answer
14 views

How to install freestyle stroke shader script to Blender 2.8

Here is the link that directs me to a script. http://freestyle.sourceforge.net/GALLERY/python.php?filename=CARTOON/disney.py&headerfilename=pythonheader.txt I have tried to copy and paste this ...
0
votes
0answers
17 views

Open blend from script and render after interface fully loaded

Blender 2.79b Ubuntu 18.10 I use CLI to start Blender. My blend file is simple animation with a movie appended to one object, to be played during animation. When I run ...
0
votes
0answers
9 views

Updating a FBX file in Blender

My question is for example I have a FBX or Collada file having 5 objects in it.I imported the file in Blender and did the Animations and Applied Materials. Now i have a update in one of the object as ...
1
vote
1answer
16 views

Is there a way to script for Lux to work on original nodes?

I recently asked a question regarding Lux's ability to output values based off of the angle of a surface relative to the viewer and I thinking, if worse comes to worse, I can just script my own node. ...
2
votes
1answer
82 views

How to stretch or compress a spiral cylinder

I have a cylinder-like spiral object as a .STL file (figure). We want to animate compressing and stretching this cylinder (figure). How can this be done? Edited:
1
vote
1answer
22 views

How to Install Multiple Add-ons with Python Script

I am constantly using new workstations where I have to install a new version of blender. While the blender cloud add-on allows one to sync settings between devices, it does not sync user-installed add-...
0
votes
0answers
8 views

Set value to property using data_path

I'm making a script where i have an array of properties data_paths (like myArr = ["scale[0]", "location[2]", "['prop']"]), and I need to set a certain value to ...
0
votes
0answers
16 views

Converting from Tree of Empty to Armature back to Tree of Empties

I'm writing an importer for an irregular model format. This is based on a 3dsmax script. The format stores the skeleton as a list of bones listing each bone's parents and two matrices, one called "...
0
votes
1answer
28 views

Python - Creating a empty per selected object and get the selected object position, rotation

I want to know how can you do the following thing in python. I have a Empty(null or locator) I want to create one for every object selected then I want that nulls to parent or constraint to the ...
0
votes
0answers
19 views

bgl Hello Triangle Blank Screen

This code should draw the "Hello Triangle" (1) that everyone starts off with but it's not showing up. Since it's in Blender, I used (3) as a reference for when to draw. That's why the code itself ...
0
votes
2answers
22 views

How Bpy.ops.mesh differs from bmesh ops

I know that Bmesh is a standalone module and bpy is an application module. But still why we have mesh related operations under bpy i.e bpy.ops.mesh , if we have bmesh? I need deep insight. Thanks
1
vote
1answer
13 views

Move selected mesh items to cursor in defined axis

I want to make a pie menu to snap selected parts of my mesh to the cursor constrained to specified directions. Example of snapping to cursor along x: I would like to do this for x,y,z,xy,zx,yx. I don'...
0
votes
1answer
28 views

How is the most bottom bar called and how can i access it

How is the most bottom bar called and how can I access it?
0
votes
1answer
18 views

How do you specify the name of a primitive created via the Python API? [duplicate]

For example, the command to create a cube is: ...
1
vote
0answers
24 views

How can I create a checkbox that will execute my code when checked?

First of all, I am a total beginner in terms of Blender API. I have been working with Python and the Blender API for about 3 days now. I already found out how to hide unwanted objects. Here is my ...
0
votes
0answers
6 views

How to link a mesh to scene with the desired local coordinate?

I create one mesh from another one via script. The rotation of the new mesh is different from the original one when I link the new mesh to the scene, because the original mesh has a Y-up and Z-forward ...
1
vote
2answers
36 views

Problem with Boolean-difference modifier – or – How to model a cuboid with two cylindric holes

Simplified: I want to generate a cuboid with cylinders as holes in Blender. When I add with a difference-modifier, I come to pretty common problems/limitations. There are lots of tips or advice ...
1
vote
0answers
20 views

How to create a script that will evenly distribute selected nodes?

I would like to create a script that would evenly distribute the locations of some selected nodes so that I can better organize my node trees. I'm seeking a script solution for this issue, instead of ...
0
votes
1answer
31 views

Making disorganised structures

I am new to both Blender and Python coding, so here is my question: Is it possible to make arrays of cylindrical structures of random heights and/or random interspace? Is it possible to code something ...
0
votes
1answer
22 views

How to save texture bake image file to local drive in python

How do i access and save a image file ? Under Image there is a Save As - option i need to know how to access this and save the image to some location. ...
1
vote
1answer
35 views

“'NoneType' object has no attribute 'action'” error when looping over objects with Python

I keep getting an error when running this. Without the first for loop it does exactly what I needed, but i need it to work on all selected objects, or objects in scene. I am still very new to python. ...
1
vote
0answers
13 views

Problem with Scripting a baking procedure

Im am importing alot of models with alot of materials attached. Therefore i wish to bake all of these into a single texture with a python script. I have a alot of trouble with the baking of textures. ...
0
votes
1answer
21 views

removing vertex groups that got a dot on its name

I need to find a way to remove vertex groups that got a dot on their names, I tried with this code but it didnt work (well, the find part works, but it is not removing the vertex group): ...
0
votes
0answers
21 views

Maximum volume occupying Bounding Box for a 3D mesh

Given a 3D mesh (.stl), can we find a bounding box such that the mesh occupies the maximum volume in the bounding box? Current Scenario: NOTE: The Bounding Box does not necessarily aligns with ...
1
vote
0answers
24 views

Blender 2.8: dynamically set particle locations via python

In Blender 2.7 it was possible to set particle locations dynamically as demonstrated in this answer. In 2.8 particle data isn't up to date unless evaluating the emitter via the depsgraph as shown in ...
0
votes
1answer
37 views

Circle select modal in addon?

I want to add "C" release circle select to my hotkeys and keep it in a portable file/addon. This seems to work when I run the script in blender, but the modal doesn't work when I start up blender. <...
0
votes
1answer
28 views

Writing to file script failed

I keep getting an error from this scrip and am unsure where I am making a mistake. ...
0
votes
1answer
104 views

Change circle segment depends on diameter

I want to program a tool for checking radial parts of a mesh. The idea is: You push a button, the scripts add an object (circle) to the scene. Then you grab it place it and when you scale this circle ...
0
votes
0answers
11 views

Where can I find an updated pyrefdef for auto complete in pycharm

I want to find an updated pyrefdef for Blender 2.80 so that I can get auto complete in PyCharm (for instance). Could it be generated in some way? Or are there a place from where i can download the ...
0
votes
1answer
23 views

unregistering a class

I have made a new object for the Add > Mesh menu and I would like to unregister it but when I try to with: if __name__ == "__main__": unregister() I get the ...
-1
votes
0answers
31 views

How to write a list of object data to a text document? [duplicate]

i am new to scripting, and i was hoping to create a list of all my objects in a scene that lookes like this. Object.name, object.location, object.rotation, object.scale \n
0
votes
0answers
70 views

Problem with c3d import, bpy.ops.import_anim.c3d(filepath)

I am using: -Blender version 2.79 -import_c3d : “author”: “Daniel Monteiro Basso daniel@basso.inf.br”, “version”: (2015, 5, 5, 1), “blender”: (2, 74, 1) I would like to write a Python script which ...
0
votes
0answers
12 views

Select Most Recent Report in Info Editor with Python

How would you select the most recent report in the Info editor via Python? I know that the most recent report will have the highest report_index value, but I'm not sure how to tell blender to find the ...
1
vote
1answer
19 views

Loop copying over vertex coordinates is not working

I'm completely baffled by this - it makes no sense to me at all! I'm trying to copy over vertex coordinates from an object in blender into a list, and at the end of the loop the entire list is filled ...
1
vote
1answer
21 views

How to use Keyframes and the Python API programmatically?

Currently I have a default cube and 400 frames. Here's what I have working without keyframing ...
2
votes
2answers
66 views

How can I create a mathematically correct arc/circular segment?

Given 3 vertices, or a chord and height, how can I create a mathematically correct arc/circular segment with an even distribution of vertices while controlling for the number of vertices. I ...
0
votes
0answers
14 views

Is there a way to use box deselect while using the tools in Blender 2.8?

Tools such as the transform, rotate, and move tools? I know about pressing B to bring it up, but I'm used to holding down control and then holding and dragging the left mouse button to deselect things ...
0
votes
0answers
15 views

How would one go by making an armature importing script?

See title. I've been experimenting with a custom version of the .obj format that has armature data. Problem is that there's no importer script, and I wanted to make one. Blender already imports the ...
0
votes
0answers
16 views

How would you make an addon both 2.7 AND 2.8 versions compatible? [duplicate]

Is it possible to put some sort of condition checking the user's blender version and depending on that make either register the class in old-fashioned way or the new API one?
1
vote
1answer
19 views

Do plugins/APIs exist to edit blender-python-scripts in Intellij IDEA?

I find the code editing environment on blender pretty stiff and it makes my development slower because I have to type every piece of code letter by letter so to say. I was just wondering if it were ...
0
votes
0answers
25 views

Are there any tutorials/resources for generating objects in random locations?

I'd like to write a script that places 3 objects of my choosing in random places in all xyz dimensions (with constant size, but varying rotations and locations) and I'm wondering where I should go to ...
2
votes
1answer
60 views

How to correctly merge two objects in blender

I am trying to merge two close boxes into one single cuboid, from the GUI I am able to successfully create the two boxes and set a boolean modifier to the first box to unify(UNION) with the second box ...
1
vote
2answers
38 views

Script or Command for selecting Adjacent Faces in Blender (see image)

I'm looking for a way to automate the selection of adjacent faces through a script, which I could then assign to a hotkey in Blender. I come from Maya, which doesn't have this ability either, but I ...
2
votes
1answer
59 views

Importing PNG files into Blender Grease Pencil

I have several Adobe Illustrator logos I would like to pop into Blender's Grease Pencil utility to animate them. Is there a good way to do this that won't have me re-drawing everything in Grease ...
0
votes
0answers
16 views

Outliner selected object to new collections ? scripting

How do I move a object from the SceneCollection-defaultLayer to a new collection without linking it ? I want the object to be removed from SceneCollection and only be in the new collection ...
1
vote
1answer
55 views

Passing data from one running instance of script to the next

I am looking for the most efficient way to save data from one run of a python script to the next. My script generates a list , say presentList . The list is made up of a number of integers. Next time ...
0
votes
0answers
20 views

Snapping copies of an object to every vertex of another

What I'd like to achieve is a python script that when run, copies an object eg. some tree (preferably not cluttering up the object list), to every vertex of another object that works like a 'grid' ...
0
votes
0answers
18 views

Explicitly defining property values in popup window?

I have been experimenting with manipulating popup dialog windows to have operators and dynamic UI but I do not know how to work with properties explicitly. I already know how to set default values ...