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 [python]

Python is an object-oriented programming language. In Blender, it is used as a general purpose scripting language and to create add-ons to extend Blender's functionality.

0
votes
0answers
18 views

How to copy and paste from a key frames of a object to other object in specific frame

I want to collaborate with others on one project. I am currently using the append function. However, work on the same object is impossible. For example, 1 to 10 frames of animation for object A and ...
0
votes
2answers
30 views

How can I set the Lamp type using Python scripting?

I am trying to set the Lamp type using Python scripting. I've got the Lamp object: Lamp = bpy.data.objects["Lamp"] But ...
1
vote
0answers
35 views

Ho to emulate Grab/Move (G) with python script?

After a few hours of searching, I have not found documentation on how to emulate the pressure of the "G" key that allows you to move an object freely with the mouse. I have a modal function and I ...
0
votes
0answers
25 views

How to delete the faces and edges of multiple objects using python?

So, how would I delete the faces and edges of more than 1 object using a script? It'd be pretty helpful. Thanks. I was trying to use ...
0
votes
1answer
26 views

What are the Images in the UV editor for and how to prevent them affecting OBJ export?

I'm not sure I understand the UV image editor and its ability to hold images. I thought it was purely to get a visual comparison between your UVs and the image you use for texture mapping, but it ...
1
vote
0answers
18 views

Can you make a node socket entirely transparent?

I know you can set a node socket's fill color to anything color, but can you also set the stroke color to any color too so that the socket is completely invisible? The need for this feature is really ...
4
votes
3answers
125 views

How to control RGB color input via python script

As part of a wider script, I'm trying to build a script that will allow me to change the Hex value of an RGB node. I'm struggling though to find where to hook in to the hex value of the input node. ...
0
votes
0answers
22 views

How to filter adding operators in contextual menu?

I need to add an operator in the contextual menu of my buttons. I found the way to do something like this here. But it adds operator in the contextual menus of every button and property, and I want to ...
3
votes
1answer
52 views

Why do I get this error? Loading large text file to Blender

Hello Blender Community, I am trying to simulate a machining process in blender. The cutting tool used is simplified via cylinder and its position is extracted to space delimited text file from NC ...
1
vote
1answer
38 views

matrix_basis vs. matrix_local for object parented to bone

How does matrix_basis vs matrix_local work for object parented to bones? Looks like ...
0
votes
0answers
33 views

How do i set transform_orientations in 2.80 in a script?

I am trying to set transform_orientations in 2.80 in .py script. That was was easy in 2.79. I was using ...
0
votes
0answers
14 views

How to keyframe the image sequence offset using Python?

How do I get the keyframe_insert to work with frame_offset? When using it from the image below, you can see that I can add the keyframe by hand, but with "Copy Data Path" I can't make it work with the ...
0
votes
0answers
7 views

How can I retrive the camera view form Blender Python and the reassign it to another project?

I am trying to use the same camera view in multiple projects for rendering the same scene from the same point of view. I am looking for a way to do it programmatically. Basically, I find the best ...
0
votes
0answers
26 views

Make rigid body fall at specific frame? frame_set not working properly? script python

I am trying to make rigid body objects start to fall at specific frames. I've tried using the following code to advance to the frame I would like, then import and set the rigid body properties. When I ...
0
votes
0answers
25 views

Make Rigid body object move at constant velocity? Script in BPY Python

I have an object that I want to drop onto a flat plane that contains other objects, may or may not collide with other objects depending on where it's being dropped. I can easily achieve this by ...
0
votes
0answers
20 views

Random position in Editing mode (Python Code)

Okay folks, here's a question for some of you python pro's. I am trying to randomize the position of an object in blender. Here's the catch: The object is a cylindrical array. To put it in another ...
0
votes
1answer
42 views

Overlapping faces : how to create new faces (interception and complements) with Python API?

Suppose I have a mesh with two overlapping faces (in general, all vertices are different): ...
0
votes
0answers
15 views

Regular Bmesh operators

I'm new to Bmesh and Blender in general, but I would like to know if there's an equivalent for the knife tool in Bmesh. Long story short, I want to do a very regular mesh over a mesh plane; only ...
1
vote
1answer
49 views

blender api - get current location and rotation of camera tracking an object

I have a camera with an object constraint to track an empty plain axes. I want to get the camera's current rotation, since when the axes move, or when the camera changes location, the camera rotates ...
0
votes
1answer
62 views

How do I have two different 'template_icon_view's in a panel?

I want make two template_icon_view previews in text editor > templates > python > ui_previews_dynamic_enum.py in ...
0
votes
1answer
22 views

How can I create multiple variables in a PropertyGroup?

I want to create a number of StringProperty's to a property group using a loop. e.g: ...
0
votes
1answer
78 views

Why are my classes and functions not working in Blender 2.8?

The buttons I created stopped working, they worked in blender 2.79. By the way, the standard buttons work, but my not. Any thoughts on this? Please tell me what could be the reason. Thank! Button ...
0
votes
0answers
9 views

UV coordinate from ray_cast?

I want to get the UV coordinate of a point on the surface of an object. I want to automatically generate new textures for many objects based on code I have written. I was thinking I would call the ...
0
votes
0answers
11 views

Python - Insert single axis keyframe?

I've been able to insert a keyframe for all of the rotation values at once easily, however, I'm attempting to insert a keyframe for only the X or Y rotation values. Doing this manually is possible by ...
1
vote
2answers
54 views

Exporting only 1 object at a time to .stl using blender script python

I have a scene with multiple objects and I want to export them individually as .stl meshes. Right now, it is just a cube and a plane, for simplicity. The cube is resting on the plane. I've tried the ...
1
vote
1answer
28 views

How to get part of a mesh with Python API, which requires breaking down some faces?

Suppose I have an object, for simplicity, created as a grid and two circles. How can I extract a mesh, which satisfies a condition: x>=0 and y>=0. This implies that the faces associated with the ...
0
votes
0answers
27 views

Ongoing problem: convertViewVec: called in an invalid context

I have an ongoing problem (Blender 2.79b) that I think many others have too. I've searched extensively and tried all available solutions but nothing works. What I need to do, is move vertices ...
0
votes
0answers
34 views

Repeating an object hundreds of thousands of times

I want to represent vector field data by arrows, one arrow representing one sample, for scientific visualization. The vector field is sampled unstructured, i.e. where there is data rather than on a ...
0
votes
0answers
18 views

Mouse click for macros in BGE

Please help, i am looking for a code, that emulate a click of mouse button, for using in-game macros. ... mouse = bge.logic.mouse JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED if sens.positive:...
1
vote
1answer
108 views

Creating new tabs in properties panel

As far as I know this was not possible on 2.7x, but with the new interface in 2.8, are we finally able to create new tabs (like the World or Materials tab) in the Properties window? Otherwise, is ...
0
votes
1answer
24 views

How do you reference a scene property by name?

Hey I have some string variables in a property group: ...
0
votes
0answers
19 views

Blender VSE - Change order of images in sequence - video

I have 20 images and i want to create a 4 minute video out of it. by just defining the order of which these images appear in the video in a lengthy list. this list would look somehow like this: 5,4,19,...
0
votes
1answer
26 views

Catch quit blender event in addon

Is there a way to catch the application quit event ? We have a plugin that runs an xml rpc server and we would like to kill it upon application quit as it keeps running in the background after we quit ...
1
vote
0answers
22 views

Check if any modal is running

I have pie menus that conflict with the keymap of other addons when being in some of their modal operators. Is there a way to check if there is any modal running and use that as a poll for my pie ...
3
votes
3answers
155 views

Script to render one object from different angles

I'm new to Blender. I'm currently working on a 3D reconstruction project using neural networks. I need to create my data set. Therefore I need to render a 3D body scan from different angles and save ...
0
votes
2answers
19 views

Trying to set a Keyframe in the Curve Data tab using Python

I've been attempting to set a keyframe for the Bevel Factor Start and End of a Curve. I've tried using ...
0
votes
0answers
9 views

Custom nodes without OSL

I want to make custom nodes, but since custom OSL nodes do not have proper GPU support yet, I was wondering if there was another option. The ultimate aim is to create a noise texture like the perlin ...
1
vote
1answer
22 views

Custom nodes on GPU?

I want to create a custom perlin noise node (NOT a node group, an actual scripted one), and be able to run it on GPU. Is this possible? OSL does not seem to be 100% supported on GPU, so is it still ...
0
votes
0answers
19 views
0
votes
0answers
27 views

*SCRIPT* Need help with FBX Exporter and hidden objects

I am creating an FBX export script with following requirements: 1-Export object selection with its underlying hierarchy / child objects (WORKS!) 2-Do this even if they are hidden (DOESN'T WORK) So ...
0
votes
0answers
16 views

How can I catch Selection event?

I have an idea of how to simulate a dynamic pivot from Softimage or Maya. To do this, you must run the Cursor to Selected command after each new selection. But how do I catch the selection event?
0
votes
1answer
36 views

Passing spline vertex property into graph to add or remove it from list

I would like to find a way to tag vertices in spline edit mode in order to append or remove them from lists. For instance; I'm placing Object instances over spline vertices and using its "tilt" value ...
0
votes
0answers
14 views

Seperate by Material produces strange output

i'm using blender via it's python API and encounter the following strange behavior. I produced the following Blend file with my code : Now i want to do some modifications on those objects as ...
1
vote
0answers
25 views

Importing meshes from other *.Blend files

I have found lots of solutions for importing meshes from other files in Blender. I have used this method from the official documentation: https://docs.blender.org/api/blender_python_api_current/bpy....
0
votes
1answer
28 views

extrusions and boolean modifiers

I'm starting to use blender and I stumbled into a couple of problems. I have several 2d shapes, mostly circles and closed polygons. For the sake of simplicity I started to work with them as if they ...
1
vote
1answer
76 views

Toggle Wireframe

How to do toggle wireframe in python? ...
0
votes
0answers
12 views

Project Mouse coords (2d) to face (3d) with Python

I want to project mouse 2d coordinates to a face that I am hitting with Python. Is it possible to store a rotation matrix of the face that I hit, so that I can always move the vertices along the face?...
0
votes
1answer
22 views

How to initialize the Sound class in Python

I am trying to set a Speaker's sound using a Python script and I was able to find that this should be done by assigning to the data.sound attribute of the Speaker ...
1
vote
1answer
17 views

How to apply a material to a selection in Text using Python

The Blender documentation explains how to apply multiple materials to various selections in Text: For example, to create Fig. Red Green Blue. you would need to create three separate materials and ...
0
votes
1answer
11 views

How to remove object of type FONT in Blender Python

I want to clear a scene's master collection in order to ensure I am working with an empty collection before I run my script which will build the scene for me. I search for answers on how to achieve ...