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

Using Python to create a popup that changes an object based on the input (but delays the rest of the python script until popup execute is finished)

This question is similar to: Using Python to create a popup that changes an object based on the input, but I want to be able to control the flow of my script based on the execution of the popup box ...
2
votes
1answer
13 views

Is there a Blender Virtual Camera? Or How to create a Virtual Camera?

Two pronged question: Is there currently an addon or process in which I can use a virtual camera in Blender? (a virtual camera is like this - https://www.youtube.com/watch?v=MAFVglxzkhI) I mainly want ...
0
votes
0answers
9 views

Does Blender 2.8 have the ability to make parametric components?

Something along the lines of this functionality from sketchup: https://www.youtube.com/watch?v=2jief0uh3jw
0
votes
0answers
12 views

Internal script modification

I would like to modify an internal file but I don't know how to replace it. Indeed, I want to modify a script in Templates>Python>Operator File Import but I ...
0
votes
0answers
6 views
+50

Change Object Index of Objects in a Collection Instance

If you make instanced copies of a bunch of objects (alt+D), then it is possible to give them different Object Indices from their originals. This is useful if you are using Object Index as a mix factor ...
1
vote
2answers
31 views

BMesh: Accessing edges of created mesh

Let’s say I created a bunch of these cones in my_bmesh object: c = bmesh.ops.create_cone(my_bmesh, segments=8, diameter1=1, diameter2=1, cap_ends=True) Is there ...
0
votes
1answer
15 views

Link python array to x-position of element

I have a python array: x = [0,0.1, 0.5, .... ,45] The number of elements in the array equals the number of frames in the scene. Can I link or upload this array ...
0
votes
0answers
12 views

Detect object change in sculpt mode - Python

I'm trying to make a script that automatically copy and apply some modifiers when the selected object is modified in sculpt mode. I'm currently using ...
2
votes
0answers
17 views

Segmentation fault (core dumped) on closest_point_on_mesh call in Ubuntu [on hold]

I triangulate an object and then call obj.closest_point_on_mesh call(). The call doesn't finish and my blender crashes. This happens only in Ubuntu, I also tried my ...
1
vote
0answers
29 views

problems with def draw (not working in my script)

I'm pretty new scripting in blender and I can't figure what's wrong with my script, the goal is to change the active brush and display all the subbrushes linked to this one, the script switch to the ...
1
vote
0answers
31 views

(location = location * 2.0) Doesn't work as (location *= 2.0)

Why this code works: import bpy location = bpy.context.object.location location *= 2.0 And this doesn't: ...
-2
votes
1answer
39 views

blf is a module or a parameter?

blf is a module or a parameter? I have read the documentation of blender, and I do not understand well what blf matters, or if it is only a parameter. I ...
0
votes
0answers
20 views

Looping over hierarchies of objects with Python

Today I'm able to select all parameters that I need. But select a object it's pretty simple, using name it's ok. But I use a very complex hierarchy in blender. As you can see just below: Thereby I ...
0
votes
0answers
13 views

How to copy multiple shapekey drivers to another object at once?

For example https://i.imgur.com/NHzls5n.jpg I want to copy object1 shapekeyA's driver to obj2 shapekeyA,obj1 shapekeyB's driver to obj2 shapekeyB,obj1 shapekeyC's driver to obj2 shapekeyC at once. In ...
0
votes
0answers
10 views

Properties are read-only in my script, mesh not regenerating on property change

I had mesh (simple building) generating script created for 2.79, and now is working on adapting it for 2.80. I've made it compiling and running (generating initial building with default params after ...
0
votes
1answer
23 views

How to transform armature via other object's data?

I want to transform an armature / skeleton of a 3D model in blender via collected data from another model. As I am new to blender I have no clue what the input data would be and how I would transform ...
0
votes
0answers
13 views

how to set active object in selected objects group? [duplicate]

I have a long time a small problem to put an active object in the object selection list in Blender 2.70. some objects are selected, but none of them is an active object, how can i via python make one ...
0
votes
1answer
33 views

Operator bpy.ops.rigidbody.object_add.poll() failed, context is incorrect

Here's a simple code that works fine as far as the .blend file with the object I'm modifying is already open. ...
2
votes
0answers
27 views

How to externally control the look of volume material?

The effect that I want to achive looks like this: The problem I have is with that colorful cube with controllable color gradient. The cones and planes can be ingnored. I have achived similar result ...
0
votes
2answers
50 views

python - how to select a vertex in a circle

Any suggestions as to how to select (in python) one specific vertex of a septagon (seven vertex mesh circle)? When I do it manually, it doesn't show up as a command or function in the python info ...
1
vote
1answer
27 views

Do i Build Blender for every change I make in the code?

I want to see how the BVH import script in blender works. I was thinking if i could print the values of the variables at different points in the code to the console then it would help me a lot.(just ...
0
votes
1answer
18 views

What is the single line of code required to change a preference in 2.8?

I am trying to use one line of code in the console to toggle... Preferences>Navigation>Orbit Around Selection ...
0
votes
0answers
14 views

Python Addon Can't Locate Submodule Folder

I'm trying to build an addon that has multiple sub-modules located in the same folder as the __init__.py that pulls everything together. It's exactly the same set-...
0
votes
2answers
35 views

Append python script for Blender 2.8

I'm trying to write a script to append an Object or a Collection from a blend file to a new file. Can someone please point what I'm doing wrong? ...
2
votes
2answers
101 views

Do “make install” on different Linux sytem than the one used for “make bpy”

I have successfully built Blender-2.80-Beta as bpy (as in make bpy) for linux in Ubuntu 18. Also when i do make install on the ...
0
votes
0answers
8 views

Can BlendDataLibraries be used as 'slave files'?

I am using the load function from BlendDataLibraries a lot in scripting, but I can find very little on using BlendDataLibraries more broadly. Can the write function (and/or others) be used by one ....
0
votes
0answers
11 views

Get 3d cursor location from mouse position

I need to find out the location of the 3d cursor given the mouse position. That is: if the user were to click at the position (x, y) on 3d viewport, what would be the location of the 3d cursor in 3d ...
0
votes
0answers
20 views

Errors when using bpy.ops.wm.open_mainfile

I'm running the following simple python code with no issues as far as the .blend file with the object I'm modifying is already open. ...
2
votes
1answer
14 views

Selection based on UV and Texture

Edit : The script work, I was using the wrong texture. following my previous question, I'm working on selecting vertices in edit mode based on the UV coordinate and a grey scale image. Here is my ...
0
votes
1answer
34 views

Reading inputs from an xbox controller?

I'm trying to read inputs from an XBox 360 controller in Blender 2.8 however my scripting knowledge is limited. I think I would have to install this python module/library/whatever the hell its called ...
0
votes
0answers
38 views

Resource for Blender-2.80 python-module for Linux

While i successfully built the blender-2.80 python module on Windows (without changing anything), i have great difficulty building it for linux (at least in Ubuntu). Is there anywhere where i can ...
1
vote
0answers
31 views

How to override the default Startup UI?

I'm trying to change the new Preset Menu UI to display the selected Preset name in the Properties Header like it appeared in the previous versions (2.79-). I know how to do it successfully, but I ...
0
votes
0answers
10 views

Sculpting in Scripting

I'm newbie in Blender. Tell me please, how can I use Python API to apply sculpting? I've tried to use bpy.ops.sculpt.brush_stroke() function, but it doesn't work.
1
vote
0answers
11 views
1
vote
0answers
15 views

MakeHuman model vertex coordinates after retargetting with Mocap?

I am writing a script which takes makehuman model and bvh files aS input and create animation. i also want to get coordinates of each vertex in image space after rendering, i write this script ...
0
votes
0answers
12 views

Call back to get notification on Operator removal

Is there a call back method that is called by Blender before removing the operator? My operator appears to get removed (message "StructRNA of type has been removed") after user clicks file-new.
0
votes
2answers
28 views

Information about blender and its computer [closed]

how r u, please can you me that which computer is best for Blender 2.8 for best result and which computer you use, What is specification of your computer, waiting for reply, thanks
0
votes
1answer
33 views

Modifying a .blend file using python script(s) need to edit text inside a scene

I want to render a batch of short videos in blender. They are all based on the same .blend file, a simple scene with a text object in front of a background. Now, the task is that each of the videos I ...
0
votes
0answers
25 views

Using python, how do I delete all text in a text block, without using cut?

I need to delete(or replace) all text, but without using Cut, because it copies the text to the clipboard. How do I do this?
0
votes
0answers
19 views

Size of image texture determining size/proportion of plane?

I do work where I render out essentially an image texture on a plane. Every time I change the image texture, I have to change the XY dimension resolution of the document, the plane scale and the ...
1
vote
0answers
15 views

Cant get modifier info in execute after running modal for the first time

I am writing a script and I am having problems accessing the new modifier created in the invoke() function from the execute() function. I have tried updating both the viewlayer and the depsgraph but ...
3
votes
1answer
57 views

How to make object translations in the UV Editor (Scripting, Blender Python API 2.8)

I'd like to to perform translations on objects within the UV Editor via a Python script. Attempts so far have only affected the 3D Viewport. From a user-based, non-scripted perspective, there are two ...
1
vote
1answer
23 views

is it possible to write a script that renders an image in blender

If i had an image on my computer which acts as a texture and an already created scene in blender which has a 3d object in it. Is it possible to write a blender script to take the image which resides ...
1
vote
0answers
6 views

Startup Scripts location override through Environment Variable?

I'm trying to modify the value of the temporary directory in the user preferences on startup. I have tried setting $TMP and ...
0
votes
1answer
22 views

How to keep a custom gizmo at the same place while changing is value?

I'm using a custom gizmo with a prop, but I need it to stay at the same place. For this, I'm trying to use the matrix_offset with a translation and the inverse value of the prop. But my problem is ...
0
votes
0answers
11 views

Blender script to auto map each face to a new sequential texture on a Terrain Grid

Does anyone know of a script that will map each UV to a new sequential texture on a Terrain Grid please. I'm manually assigning map tiles 1 to texture 0001 (starting bottom left corner), map tile 2 to ...
2
votes
1answer
110 views

Context Problem in Blender 2.80 python module

I run Blender 2.80 as python module (for running on a server with Django), so there is no gui. Apparently passing the correct context doesn't seem to work for me in this case. I have tried many ...
0
votes
0answers
21 views

UI Tool Template (python)

I tried running the UI Tool template (template-python-UI Tool Simple). The registration went fine and I could see the new 'My Circle Select' group on tool shelf. But when I try unregistering the tool ...
0
votes
0answers
8 views

Delete NURBS control points using a script in blender 2.8

It's possible to add points to a NURBS Curve using bpy.context.active_object.data.splines[0].points.add(), however there doesn't seem to be a ...
0
votes
0answers
10 views

Add thickness to the object by python script

I'm new to Blender. I was wondering if there is a way that I could add the thickness to the object via a python script. However, I only know how to do it by the UI interface. Does someone have any ...