All Questions
56
questions
28
votes
1
answer
31k
views
Blender 2.8 API, python, set active object
I'm trying to amend an addon that I made for Blender 2.7X to work with Blender 2.80.
The problem is with
bpy.context.scene.objects.active = some_object
This is ...
16
votes
3
answers
17k
views
Update viewport while running script
I have a script, which creates multiple objects through a loop. However, the script freezes the viewport until it is done. Instead, I would like every object to be seen in the viewport one by one as ...
10
votes
2
answers
2k
views
Copy framebuffer of 3D View into custom frame buffer
General question: Is there a reliable way to directly access the OpenGL framebuffer of a View3D for copying?
(Please see the end of the post for more detailed questions)
I need a very fast way to copy ...
16
votes
1
answer
5k
views
python get "image" of 3D view for streaming / realtime EEVEE rendering
[SEE Edit #7 at the bottom for official, final question]
I know its possible to take a screenshot with python of a particular window (take screenshots programmatically in bge?), but is there a better ...
1
vote
1
answer
1k
views
How do I get the deformed coordinate of a vertex with Python?
How might someone find the deformed coordinate via Python or otherwise when using a subdivision modifier with the 'show on cage' option?
For example, a subdivided cube with cage enabled and a vertex ...
18
votes
2
answers
13k
views
How to automatically fit the camera to objects in the view?
I'm using blender to render avatar and avatar accessories on a website, however there is a problem, when a hat, or accessory is made a bit large, the it doesn't fit in the viewport, is there anyway to ...
13
votes
4
answers
19k
views
How to toggle visibible / selectable / renderable for multiple objects?
For quite long time, I was looking for a faster way to toggle (or toggle off) visible / selectable and renderable for many objects, as illustrated below:
I know we can do the relatively quick select ...
6
votes
1
answer
1k
views
Set orthographic view using python?
Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7?
Thanks in advance!
2
votes
1
answer
2k
views
How to "Hide a Collection in viewport" but not "Disable in Viewport" via script in Python
Hi Blender coders and artists.
I am updating one of my add-ons for Blender 2.8 and have run into some issues finding the appropriate way to hide a collection that is added to my scene.
I want to ...
1
vote
1
answer
725
views
What is the Python command to check if current view is in orthographic or perspective mode?
What is the python command to check if current view is in orthographic or perspective mode?
22
votes
5
answers
22k
views
How to set cursor location, pivot_point in script?
I am trying to set a cursor location and pivot point with
bpy.types.SpaceView3D.pivot_point='CURSOR'
bpy.types.SpaceView3D.cursor_location = (0.0, 0.0, 0.0)
and ...
10
votes
2
answers
14k
views
How to get mouse position in a window with Python?
I want to detect if the mouse is in certain area of the 3d View, so I can display a custom menu when it will be in the left top corner, over the view name ("User Persp" etc).
5
votes
2
answers
5k
views
Viewport position and direction
How to get Viewport Position, Direction, UpVector?
For Perspective and Ortho views.
Here is explanation Screenshot:
3
votes
1
answer
324
views
How to use view_center_camera for fitting camera to 3D view?
This function is supposedly the one for fitting the camera to 3D view with python(with mouse cursor hovering over the 3d view):
...
1
vote
1
answer
515
views
Get view and perspective matrices of the current 3D viewport (not camera)
I'm making a script allowing me to apply fragment shaders to the 3D Viewport real-time. However, I don't know how to get view and perspective matrices of the current point of view. I know how to get ...