How to get bounding box of multiple objects in a rendered image with Python? Hello I am trying to get bounding box of items in my image which is generated automatically using a script by running blender from background. I am using the object index to get the boxes.
This is my current compositor setup,

This is the code I am using to find the boxes
import bpy
import numpy as np

def getVisibleBoundingBox(objectPassIndex,pixels,height,width):
    bbox = np.argwhere( pixels == objectPassIndex )
    (ystart, xstart), (ystop, xstop) = bbox.min(0), bbox.max(0) + 1
    return xstart, xstop, height - ystart, height - ystop

def getAllBoxes():

    S = bpy.context.scene
    width  = int( S.render.resolution_x * S.render.resolution_percentage / 100 )
    height = int( S.render.resolution_y * S.render.resolution_percentage / 100 )
    depth  = 4

    pixels = np.array( bpy.data.images['Viewer Node'].pixels[:] ).reshape( [height, width, depth] )
    print(max(pixels[540][1]))
    pixels = np.array( [ [ pixel[0] for pixel in row ] for row in pixels ] )
    boxes = []
    for i in  bpy.data.collections['CurrentItems'].objects:
        boxes.append([getVisibleBoundingBox(i.pass_index,pixels,height,width),i.name.split('.')[0]])
    return boxes

print(getAllBoxes())

This all worked fine when tested it with the gui but when running blender as background from command line it just gives this error
ValueError: cannot reshape array of size 262144 into shape (1080,1063,4)
I believe that is the empty viewer node image thats causing this.
Any ideas on how to get the image or some other method to get the bounding box that would work from background would be most helpful.
I have also tried saving the image as PNG and tried using that but it seems the objectPassIndex data is lost when saving as png.
P.S. I dont want to use world_to_camera_view as there is no reliable way to check for occlusion with that method.
EDIT: The bounding box needs to be a rectangle with the whole object inside it.
If a object is occluded by some other object then only the visible part be included in the rectangle.

A solution that worked for me was to use an File Output node instead of viewer node and save the image in openEXR format with full float color depth using this node setup

And then read that image via CV2 library instead of reading it from viewer node image.

Simply replace the following line in the code snippet in question

pixels = np.array( bpy.data.images['Viewer Node'].pixels[:] ).reshape( [height, width, depth] )

with

pixels = cv2.imread(r"filepathOf.exr",  cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)
pixels = cv2.flip(pixels,0)

and it should work fine giving you coordinates of the bounding boxes


Modelling an airplane with a irregular shape I'm trying to model this plane, which is the ME 262(1941) :

As you can see, the plane's nose is in a conic shape; however, the rest of the body is triangluar-ish. As a result, I'm having some problems modelling the plane since the transition from the conic shape nose to the triangular body is weird. I need the two to transition properly and smoothly. Could somebody help me with this? Thank you.

Start by adding a edge around the "triangluar-ish" part. Add a circle with the same number of vertices as the outer edge.
Then open up the specials menu with W, and find the Bridge Edge Loops command.

In this picture I have a mirror modifier so I only have to model half of the plane.


How to transfer attributes from source mesh to distributed points? Let's say I have a Vertex group, that controls a point distribution:

Point scale disabled because it doesn't work as expected
But if I want to scale points by this Vertex group, I can't do it, because  distributed points lost all attributes from source mesh. Any way to get them back?
UPD.
Distributed points lost all attributes from source mesh in 2.92, but not in 2.93:

The Geometry Nodes does not delete any attribute e.g., Vertex Weight (Group), however, it can override it or create a new one.
For Blender 2.93: In your example, to control the scale of the points you have to control the radius attribute of the points. So, you can assign the weight from the Group attribute to the radius attribute with the help of the Attribute Math node,


How can I make the viewport run faster? I am working on a really complex mesh that I am using for product design, so I do not intend to render it. Due to its complexity, blender is running really slowly and it takes a few minutes to make any changes. Again I do not want to render this, I want to speed up blender in edit/object mode when I model the mesh.

Scene > Simplify
(don't go in edit mode with a mesh with a lot of subdivision: for example don't go in edit mode on a mesh you sculped)


How to export vertex colors or vertex group as polygroup for export? I would like to know how is the correct process to export a 3D model with correct "vertex group" or "vertex color"  to use in zbrush as polygroups to make my work easy.

1 - first of all I modelled this bucket in blender to use as Insert multimesh.

2 - the next step is create a "vertex paint" ?.

3 - then I go for export menu ,  choose as obj file , but before , I apply 0,0,0 to (r,l,s transformations) and go to this tab (check if this board are correct , I do not know what's the effects in those blue box I ve marked).

4 -  Now , In zbrush there are not polygroup (one for the strap , one for the metal button and one for the main bucklet , I just see only one polygroup for all the object see the image).

5 - the most quick solution is to separate the mesh in zbrush and create differents polygroups manually for every bucket and his pieces, metal button and main strap. but I prefer to use blender with group previously.

Go to Edit Mode and select what you want to Polygroup.

Go to Object Data tab and click plus next to Vertex Group then assign with your selection active and name if you like.

On obj export make sure the Polygroup box is checked.

ZBrush doesn't use smoothing like Blender does you need to subdivide to make it look smooth.


Compositor Glare Node I have recently been learning the compositor feature and have been running into some confusing issues. When i connected the glare feature to add glow to a scene, absolutely nothing happened...
also i recently made another scene where i have multiple glowing objects and all but one is glowing?!?!?! see attached image.
I've used glare multiple times now with no problems but twice now i ran into this problem.
thank you in advanced!

@GordonBrinkmann
@Daniel - https://drive.google.com/file/d/1UlLXuRFI9rgjxSwlm8Kr1q2K2dvb0YtG/view?usp=sharing

I don't know about all of your scenes. But in the screenshot the emission of your glowing objects doesn't seem very strong, but the Threshold in your Glare node is set to 5.3 which is quite high.
Here's an example: the following cubes have three different colored emission shaders, each with a different strength. The red has a strength of 2, the blue one a strength of 4 and yellow only 1.

They look not to different in brightness although they are, which of course depends partially on their color. If you now plug the image into a RGB to BW node which sets R = G = B according to the brightness, it looks like this:

Although the yellow emission has a strength lower than blue and red, it has the highest value. And especially important: although they all have an emission strength of 1 or higher, all values are below 0.8 which is relevant for the Threshold of the Glare node.
Since no value of any emission was 0.8 or greater, setting the Threshold to 0.8 allows no glow on any of the three cubes.

But if you lower it to 0.7, a value that blue and yellow exceed, the glow starts to show on those cubes. The red one is still to dim.

Actually I don't know why the blue glow looks more intense than the yellow one, maybe because once the threshold is passed, the higher strength plays a role as well. But apart from that it's important that your threshold is low enough to let the emission through. An emission strength of 5 doesn't necessarily mean it's really brighter than 4 (unless it's pure white I guess).
Here's just one tip how I usually add glow to my images. In the Glare node I set the Mix value to 1, this way it only outputs the glow effect. Then I add it to the image by plugging it in the second socket of a Color Mix node. This way I can use the factor to reduce the glow if it's too intense, but also boost it by setting the factor higher than 1.

EDIT: Now I've downloaded your file and worked a little on it. First of all here are some things about your Compositor setup: the Mix factor in your Glare node is still on 0.3, which means you don't have the glow separately on the output but mostly the original image with glow on top. You should set it to 1 so that you have full control if and how much glow you want to add in the Mix RGB node. There you just have a factor of 0.575, which means you're adding a lot of the original image on top of itself but not the full glow. Another thing is, you're plugging the denoised image into the Glare node. But denoising averages values which could also lead to reduced brightness and thus less glow. And by the way: the Denoise node works quite well and it doesn't need enabled Sampling > Denoising in the Render Tab. That just makes the rendering slower and the Denoise node in the Compositor works better. Actually I don't even enable Denoising Data when I use it, in normal scenes it doesn't make a noticeable difference. With Denoising enabled my render time was 47.81 seconds, without 35.10 seconds.

Here's my Compositor setup:

Note that I've set Mix in the Glare node to 1 and also the Add factor in the Mix RGB node is set to 1. And the quality of the Glare is set to Medium instead of High - usually this is good enough and it results in more glow. With these settings I got a good glow on all objects with green and yellow at a strength of 10, red at 15 and blue with a strength of 30. The problem is, red and blue are always "darker" than green and yellow so they need higher values. Also the more saturated the values are the less bright they get, for example if you have R/G/B = (0/0/1), even multiplying by 100 will never make R and G more than 0. But with (0.01/0.01/1), R and G get higher, too which will result in emission that's turning to white the brighter it gets. I also moved the black slider on the blue emission material slightly to the left so there are less dark parts in the material.
Now for comparison, your blend file:

My version, of course it looks darker because I've decreased the strength of each Emission shader. But since the emissions of the rings are the only light sources, the surroundings become darker, too:

To compensate for that, I've made an "enhanced" version. First of all I added the picture onto itself as your setup does eventually, so it brightens up the environment. Then I've added the glow with a factor of 2 instead of 1. Now it looks like this:

All in all, the crucial things are these:

Blue emission and also red will always be darker than green or yellow, so the effect could be less or needs more emission strength.
You should always set the output of the Glare node to 1, to show only the effect and not the original image mixed in. This way you can decide how much effect you add to the picture, especially going higher than "full effect" cannot be done with the Mix factor in the Glare node.
It's best to use the direct image output for the Glare node instead of an already denoised version, although it might not make a difference in most cases.

Here's my edited blend file, with enhanced and standard composition. I didn't pack the textures into it because that would've been too big:


How can I disable one OpenCL device I have successfully enabled the experimental OpenCL support and my scene (surprisingly) renders fine, without any crashes or artifacts.

My setup consists of two AMD cards and an Intel CPU. Choosing either card as a GPU Compute device works fine. Enabling all devices together also works, but (presumably due to different cycles feature set supported) some tiles are differently lit. Moreover, the render is slower, as for some reason the GPU's wait for the CPU to finish before going on to the next tile.

The question is, is there a way to enable both GPU's but not the CPU as a compute device?

There is currently no way to do what you want from blender.
You can however set CYCLES_OPENCL_TEST to "GPU" and see only devices in blender that claim to be a GPU.


keyframe object in and then out of scene Imagine I am going to take a gun out my pocket and then fire

I can keep the gun next the side of the pocket. How do I keep this out of the scene but then into the scene as my character picks the weapon?

In any other instance where one would like an object to not appear in the scene but then appear. How does one do this?

Object visibility can be animated (keyframes):

Two visibilities: one for viewport and one for rendering. You may need to keyframe twice.

To add a keyframe, place the timeline where you want then change the visibility checking or unchecking the visibility, then:

Either place the mouse cursor on the check box and use I
Or use RMB on the check box and choose 'insert keyframe'

So you can blink an object:


Bake the animation of a rig following another rig I have a Kinect Rig imported into Blender.
My character is moving thanks to another rig (lets name it the Character's Rig) which is following the Kinect rig.
I cleaned up the animation of the Kinect rig, and made some adjustments in pose mode to the Character's rig (mainly foot rotation).
Everything is good, except that sometimes in the viewport, and everytime when rendering, some of the adjustment are not calculated (foot rotation correction for example).
Is there a typical workflow to bake the animation of my Character's Rig, so that I can delete the Kinect rig, making my Character's Rig absolutely independant ? What are the different ways to achieve this ? Especially if I need to use the NLA Editor after this.
I know there's the Pose > Bake Action solution in Pose Mode, but is it really what I need ?
Thanks ! :)

Go to Pose Mode and select all bones of your character's rig.
Select Pose->Animation->Bake Action like below:

then select Only Selected Bones + Visual Keying + Clear Constrains + Overwrite Current Action


Why do I get large bevels on a curve with such a small bevel object? I am bevelling a simple circle with another simple circle and as you can see from the screen shot below I have to make the bevel circle incredibly small and I still end up with a very large cross section. I don't understand why the cross section on the bevelled curve isn't the same size as the bevel curve.

You will have to :

apply the scale Ctrl+A
select all point of the curve and reset the radius back to 1 :

Note : to avoid applying the scale just set the radius to  1/scale


Cloth Simulation: How to keep vertex groups unaffected? I am trying to create a simulation of holiday lights hanging from a ceiling. I am using pin groups on the "cord" part of the mesh to give the effect of the lights hanging. When I run the simulation, the lights themselves also deform. I want them to hang down but maintain their shape. Is there a way to allow a vertex group, which in this case would be only the lights, to remain stiff?
EDIT: Lowering the vertex mass does help create the effect I am looking for, but are there other solutions?

Quick answer:
the way to do this is to separate the lights and pin them to the cloth sim.
Long answer:
Step 1:
separate each light to it's own object
Step 2:
at the top of every light create an empty
use Shift S to snap the 3d curser to the vertices at the top of each lamp and add an empty there
Step 3: Select 1 of the empties and Shift select after that the wire
Step 4: go into edit mode and find the nearest vertex and select only it.
Step 5: Now that our empty and our vertex are selected, press Ctrl+P and click "Make Vertex Parent"
Step 6: go out of edit mode and deselect all. Now Select the Lamp were working with and then select the corresponding empty.
Step 7: Press Ctrl+P again and parent the lamp to the empty with the "Keep Transform" option

Step 8: Repeat from Step 3 to Step 7 for each lamp and corresponding empty
Step 9: Make sure only the wire has the Cloth simulation
And Were Done!
(I know I went into detail, but since a lot of people deal with cloth simulations I want this answer to be good for beginners as well)


How flip model upside down? What I have:

What I want:

Can I get it without playing with rotation degrees? Mirror is not working well for me.

You should be able to achieve this by using a custom transform orientation.

With your object selected, tab into Edit Mode. Select an edge that you want to scale along.

For example:

Then, still in Edit Mode, click the [+] symbol under Transform Orientations.

This adds the selected edge as a new Orientation.

It is handy to give it a name under the tool shelf on the left side.

Now you will see this:

 and

Finally, select all, hit S to scale and then TWICE the axis the points in the same direction as the edge you selected and -1 on your keyboard.

In my case it is the y-Axis.

So I would hit S,y,y,-,1.

Before:

After:

On the bottom left you'll see:

Unfortunately, that will mess with your Normals. To solve that, simply hit Ctrl + N. In my case, I had to manually select and flip the Normals inside the B's arcs.

Not a big problem, but if anyone knows how to get around this, please comment.

Result:


How to make different layers of mesh in circle z-axis by grouping different meshes? I am trying to group many meshes in a colour and aligning them together. My aim is to make a ring of colours so they have a layer or ring that will go in. I think it is a little bit difficult to explain. Please see the Picture 1 below.

I think you can see what I am trying to do. The inner core should be green meshes and it should be circulated by blue meshes that I have grouped and aligned together.
The end product should be like an arrow with different layers with each layer having separate mesh bricks as units.
I think you can agree that it does not look very professional and round. Is there a better way to do this rather than just copying the mesh group (see selected blue mesh second layer) and duplicating it and moving it above. How do I join two meshes on either side without doing it manually and really labouriously.
I'm new to Blender. Thanks in advance for your help.

Particle System

A Cylinder has a Particle System.  This ensures the circular pattern. Use multiple objects with particles systems, such as a plane.  The object which owns the particle system does not need to be rendered.  The yellow [brick] is duplicated along the vertices of the cylinder.  Settings are shown in the Particle Systems Panel in the image above.  You can see many tutorial videos on particle systems on various web sites.

Click on image to see larger version.


Access points along a bezier curve I've got a tube, created from a bezier curve, similar to this example. I'd like to be able to move an object along this curve, as if it were a spline, in Unity. From Unity, I need access to each point in world space, so that I can adjust the object that moves along it programmatically (Animation will not work).

Is there a nice way to turn the various points along that curve into objects that I can then get the position of inside Unity, or do I have to manually add objects?

Thanks in advance for any hlep!

Would it be practical to use the formula for a Bezier Curve (wikipedia article)?

You can evaluate it for t varying from 0..1.  One complication is that the distance between evaluated points will vary, so if you want constant speed you'll have to compensate by adjusting your time->t mapping.  P0..P3 correspond to the points and handles of each segment of the bezier curve.

Here is a short python example of how to inspect the control points and handles of a bezier curve (in case you are unable to inspect them in the N-panel pop-out of the 3D view):

import bpy

def mission1(curve):
    for spline in curve.splines:
        for kp in spline.bezier_points:
            print("%r"%[kp.handle_left, kp.co, kp.handle_right])
        print("")

mission1(bpy.context.active_object.data)

See also Mathematical formula for Bezier curves  and How can I know the data paths of certain point of bezier curve?


Delete operation history from python? How to delete the History from python?

When I click the History button in Tool Shelf > Object Tools > History, it shows list of the operations I did.
How to clear this with python code?

I believe the answer is no.
However, you can clear the list by saving and reopening the .blend:
From the UI:

Save the file with CtrlS

Reload it with CtrlShiftO1

With python:

Save the file with save_mainfile()

Open the file with open_mainfile()

For example:
import bpy

file="/tmp/test.blend"
bpy.ops.wm.save_mainfile(filepath=file)
bpy.ops.wm.open_mainfile(filepath=file)


Model doesn't change after sculpting Blender 2.91.2
I'm new to Blender and I can't work out how to solve this problem.
I've made a model and tried to shorten the neck in Edit mode, but then it created a hole, so i filled it using F. That made the place where was the hole look rough. Now when I try to smooth it, the modifications don't save and the rough place remains unchanged.
I've already tried making manifold with 3d-print Toolbox, but it but it doesn't change anything. The more vertices I remove, the rougher the place becomes.

In Edit Mode. When I try to delete the rough place and use Grid fill, Blender crushes.

It's the Multires modifier. It does not like changes on the underlying mesh and this can result in strange spikes or something like you have.
You can try to fix it with the Multires Displacement Eraser brush in Sculpt mode (requires Blender 2.9+). I am not sure if that helps but it's worth a try.
If it doesn't help, you can fix it with the 'cut-off' method:

In Edit mode, select the bad faces of the low poly mesh and separate them with P, Separate > Selection
Switch to Object mode, select the new object with the bad faces and remove the Multires modifier. The faces should now look clean and 'low-poly'.
Select now both objects (the cut-off object and the original with the hole). Make sure you select the original last (=active object, orange selection color. This way it will keep the Multires modifier.).
Join the objects (Ctrl+J). (If the Multires modifier disappeared then you selected them in the wrong order, Ctrl+Z to undo ;-)
In Edit mode, select everything with A, and merge the loose meshes with M Merge > By Distance

That's it. The mesh should look nice again, except for the "low-poly spot". You just must add the missing details (Sculpt mode) for the spot.


VSE problem blurring license plate - mask is jumping all over video I followed the Youtube tutorial by Mikey Cal Meyers on how to blur out an object in a strip. (All of his others have been so excellent). I followed his instructions to the tee, built the mask, got it all keyframed perfectly against my raw, never-cut strip. Then when I reviewed the mask playback over the video, it jumped all over the place, and did not follow the mask keyframes playing alongside in the identical video in the mask window. I went back and redid the steps from the tutorial, and got the same undesirable result.

I am running Blender 2.77 on a 64-bit laptop running Windows 8.

Anyone have experience overcoming this hurdle?

It's likely that you're running into the problem between Interframe Compression vs. Intraframe Compression.

Blender (and other video editors) often have trouble scrubbing through video that has been compressed referentially. In this type of compression, one frame is encoded as the changes from the previous frame, so all the data isn't there for every frame. This means, it's really easy to get lost between keyframes. I've seen this problem when I'm tracking video it seems like the track is really bad, and jumping all over the place, but what's really going on is the frame you're seeing isn't the right frame for that time signature.

Try converting to an Intraframe format (each full frame is compressed individually) like a JPG image sequence in an AVI container. Blender can do that conversion pretty easily.


How to combine faces of an array (roof)? The goal is to combine the faces, instead of having them overlap. That overlap of faces actually is very chaotic and difficult to combine if I make the object that I'm arraying (a spherical fragment) smaller (this gives it a nicer, smoother look). It seems as though there should be a simple solution to this, but I have no idea what this solution is. After all, array merging seems to affect the whole fragment instead of just the top faces. I've tried booleaning, grabbing (changes dimensions while it is arrayed), changing it into a curve (seems to mess everything up), and re-sizing it. The curve that it follows is directly below it and follows the wall's pattern. Anyway, maybe someone knows another option...?

File:

Delete the curve parts on the sides and keep the middle section (that is perpendicular to the "columns") then do bridge edge loops. You will be able to control the number of cuts and the curvature (smoothness)

Here's an example on how to connect two cylinder segments that have the same number of vertices, select the end edges and use Bridge Edge Loops, and adjust number of cut and smoothness.


Is boolean a reliable way of intersecting 3d printed objects? I am making a character to 3d print. And I want to use boolean to stick the head to the neck in the perfect position.
I placed the 2 strips so it will align perfectly.

Now the problem is, if i do it this way, will i be actually able to stick it in?
It would have to be perfectly 3d printed. And even if it did, I don't think the gap is too big for the neck to intersect with the head.

CAD geek here.
You will need atleast some kind of margin between the two surfaces, or you will have a fit that is too tight, and while you can push it in probably, there is a chance (depending on printing filament) your piece will start to crack at the surface joint.
For as to how much margin to use, look up the minimum tolerance of your 3D printer, and use that as a rule of thumb.
If I can give you another tip, I would suggest to remake your joint with primitive shapes, this will make it much stronger, it will be easier to adjust your margin, make positioning easier, and keep it in place much better.
Example made in 2 mins with Booleans below :


How to bevel a vertex corner that is between a circle and straight? Only way I can imagine doing it is by manually adding a circle and editing it into the shape. Which is slow. Same with knife project and that also creates other issues and is also slow. Maybe there is some magical hotkey with the bevel that can do it or something?

This pretty much exactly what the Spin tool is for ..

In an orthogonal view of the circular arc you want to create, put the 3D cursor at the center of the new part-circle, select the vertex you want to extrude around it, and invoke the tool.

In your case, you might ShiftS snap the cursor to the two selected endpoints of the bevel, so it's exactly between them.

You can adjust the center during the operation by using the arrowheads, and the number of vertices generated in the sweep using the tool's Adjust Last Operation panel


Texture doesn't seem to apply to this model I'm trying to work this model:
https://opengameart.org/content/undead-male
When I open the model the textures provided are not applied. I select the face, arms and leg and go into the UV Editing tab where I add a texture. It looks like the model is unwrapped correctly on the texture, but the model still is just showing it's base color. I know I'm just doing something fundamentally wrong here.

I was able to achieve success by selecting each the body and head, respectively, and opening a Shading Editing window. From here, I checked the "Use Nodes" box, and added an image texture, mapped to the UV coordinates.


Rotate UV by specific angle e.g. 30deg in Python script in backgroud mode I am trying to figure out how to rotate UVs in mesh while Blender is in Background mode without windows, so some parts are not accessible.

Right now I am using bpy.ops.mesh.uvs_rotate() > this works, but it is just in 90 degrees, so I am not able to set UV rotation in specific degree.

bpy.ops.object.editmode_toggle()
bpy.ops.uv.smart_project(angle_limit=66, island_margin=0, user_area_weight=0)
bpy.ops.uv.reset()
bpy.ops.mesh.uvs_rotate()

On this http://blenderartists.org/forum/showthread.php?267997-Rotate-the-uv-s-of-a-selected-object-instead-of-the-object-itself there is written, that I should use bpy.ops.transform.rotate(value=math.radians(45)) while being in bpy.context.area.type = 'IMAGE_EDITOR'.

The problem with this is that when I run blender like

blender  --python-console --background

>>> import bpy
>>> bpy.context.area.type
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'type'
>>>

It seems that object bpy.context.area.type is not possible to change, because it does not exist. In overall our code, we try to not use this. But it case of UV I am not able to figure out how to do it without this. I know that there is a lot of problems with these context.

So how should I rotate UV without context. Is it possible? Or is there a different way how to rotate image on separate object by specific degree?

you can do the math yourself , if nothing is available :
rotate all the points around the center of the image (0.5, 0.5)

import bpy
from math import cos, sin, radians

def make_rotation_transformation(angle, origin=(0, 0)):
    cos_theta, sin_theta = cos(angle), sin(angle)
    x0, y0 = origin
    def xform(point):
        x, y = point[0] - x0, point[1] - y0
        return (x * cos_theta - y * sin_theta + x0,
                x * sin_theta + y * cos_theta + y0)
    return xform

ob = bpy.context.object
rad = radians(30)
anchor = (0.5, 0.5)

rot = make_rotation_transformation(rad, anchor)

UVmap = ob.data.uv_layers.active
for v in ob.data.loops :
     UVmap.data[v.index].uv = rot(UVmap.data[v.index].uv )

the make_rotation_transformation  is from this answer   by @200-success


How to import bone locations form a text file? I've used a script to extract my bones location to a text file and I was wondering if I could use this text file to import the locations to a new project in blender using another script.
Keep in mind that I literally have no knowledge of Python (I found the script that I've used to export the bone locations from another place and kind of modified it to suit my needs) and I'm very new to blender as well and was hoping if someone could help me out here.
Here's the text file I mentioned:
Current Frame 0
Bone000: HeadX:-0.0 HeadY:-0.0 HeadZ:0.0 TailX:-0.0 TailY:0.10000000149011612 TailZ:0.0
Bone001: HeadX:-0.0 HeadY:-0.0 HeadZ:1.2218284606933594 TailX:-0.0 TailY:0.10000000149011612 TailZ:1.2218284606933594
...
Bone140: HeadX:-0.0 HeadY:-0.0 HeadZ:0.0 TailX:-0.0 TailY:0.10000000149011612 TailZ:0.0

This is where I found the script:
https://blenderartists.org/t/save-bone-position-and-rotation-in-a-txt-file/1219916
this is what I changed it to:
import bpy

start_frame = 0
scene = bpy.data.scenes["Scene"]
armature = scene.objects["Armature"]
outputfile = bpy.path.abspath("C:\\Bones.txt")

pose_list = []
rota_list = []
buffer = []

def export_bone(bone):
    pos0 = bone.head
    pos1 = bone.tail
    # log and append to buffer
    msg = "{0}: HeadX:{1} HeadY:{2} HeadZ:{3} TailX:{4} TailY:{5} TailZ:{6}".format(bone.name, pos0.x, pos0.y, pos0.z, pos1.x, pos1.y, pos1.z)
    print(msg)
    buffer.append(msg)

# loop all frames
print("Starting Export")
scene.frame_current = start_frame
while scene.frame_current < scene.frame_end:
    # log and append to buffer
    msg = "Current Frame {0}".format(scene.frame_current)
    print(msg)
    buffer.append(msg)

    # change frame
    scene.frame_current += 0

    # export all bones of armature
    for bone in armature.pose.bones:
        export_bone(bone)

# output buffer to file
with open(outputfile, "w") as f:
    f.write("\n".join(buffer))'

Any help would be much appreciated
Cheers

The script you have doesn't dump a lot of important information, like the bone roll, or parenting info.
Assuming you're trying to dump the editbone info, this script should work. By default it exports. Change command in the options at the top to 'IMPORT' to import instead.
# !!!! Options, edit me!
path = 'C:\\Bones.json'
command = 'EXPORT'  # EXPORT or IMPORT
# !!!!

import bpy
bone_props = [
    'name', 'head', 'tail', 'roll', 'use_connect',
    'use_local_location', 'use_inherit_rotation', 'inherit_scale',
]
if command == 'EXPORT':
    ob = bpy.context.view_layer.objects.active
    if ob and ob.type == 'ARMATURE':
        pass
    else:
        obs = [ob for ob in bpy.data.objects if ob.type == 'ARMATURE']
        if len(obs) == 1:
            ob = obs[0]
        else:
            raise RuntimeError('Select an armature')
    arma = ob.data

    data = {}
    data['armature'] = {}
    data['armature']['name'] = arma.name

    if bpy.context.mode != 'OBJECT':
        bpy.ops.object.mode_set(mode='OBJECT')
    bpy.context.view_layer.objects.active = ob
    bpy.ops.object.mode_set(mode="EDIT")

    data['edit_bones'] = []
    for ebone in arma.edit_bones:
        bonedata = {}
        bonedata['parent'] = ebone.parent.name if ebone.parent else None
        for prop in bone_props:
            val = getattr(ebone, prop)
            if prop in ['head', 'tail']: val = list(val)
            bonedata[prop] = val
        data['edit_bones'].append(bonedata)

    bpy.ops.object.mode_set(mode="OBJECT")

    with open(path, 'w') as f:
        import json
        json.dump(data, f, indent=2)

elif command == 'IMPORT':
    with open(path, 'r') as f:
        import json
        data = json.load(f)

    arma = bpy.data.armatures.new(data['armature']['name'])
    ob = bpy.data.objects.new(arma.name, arma)
    bpy.context.collection.objects.link(ob)

    if bpy.context.mode != 'OBJECT':
        bpy.ops.object.mode_set(mode='OBJECT')
    bpy.context.view_layer.objects.active = ob
    bpy.ops.object.mode_set(mode="EDIT")

    for bonedata in data['edit_bones']:
        arma.edit_bones.new(bonedata['name'])

    for bonedata in data['edit_bones']:
        ebone = arma.edit_bones[bonedata['name']]
        if bonedata['parent']:
            ebone.parent = arma.edit_bones[bonedata['parent']]
        for prop in bone_props:
            setattr(ebone, prop, bonedata[prop])

    bpy.ops.object.mode_set(mode="OBJECT")


Making a hole in a mesh while keeping the integrity of texture So I'm attempting to create an animation where an image has a hole appear in it, and then the camera zooms through the hole. I tried using shape keys, but since the uv unwrap is mapped for one shape key, it gets messed up when transferred to the other shape key. Is there a way to make this possible?

Well I figured it out. The best way for me to keep the integrity of my texture was to go into the node editor and change the "texture coordinates" to "Object" instead of "uv coordinates"
Thanks a bunch you guys! :)


Export keyframes as baked meshes? Looking for a script that runs through the animation frames and at each keyframe it exports just the mesh as a .fbx (no cameras, bones or helpers) at that specific frame, preferably with a filename that includes the frame number.

If nothing like this exists, I'll attempt to write it myself soon, but I've never written a blender script before and it's been years since I used Python at all, so I may need some instruction (library reference or similar).

Using this output as an input for morph targets in another application.

You may get away with

Scene.frame_set
bpy.ops.export_scene.fbx

I.e. select your meshes and run

import bpy

PATH = "your_path.%03d.fbx"

for i in range(100):
    bpy.context.scene.frame_set(i)
    bpy.ops.export_scene.fbx(
        filepath=PATH % i,
        object_types={'MESH'},
        use_selection=True
        )

The source code of export_scene.fbx resides in scripts/addons/io_scene_fbx.


Tab key sometimes switches between Object/Edit mode, but sometimes between Weight Paint/Edit Normally, when I hit Tab while in Edit mode, I switch to Object mode, and vice versa.

However, at seemingly-random times, I will hit Tab in Edit mode and instead switch to Weight Paint. Hitting Tab again does not return me to Edit mode.

I cannot figure out any reason for this. Is there something I don't know about Blender's hotkey system?

That's how it works. If you go into a paint mode via a mouse click and then hit tab it will switch between edit and paint mode. Now if you go and click on the object mode and then hit tab it will switch between object and edit mode.

That is to say the last mode you select via a mouse click becomes the sticky mode that the "tab" key will switch to.

The beauty of this is so that when you need to do different sets of operations you could.

Vertex paint > edit
Object mode > edit
Sculpt mode > edit
etc ... you get the point I hope.


I am trying to make a background, but the sky emits a light and tints the rest of my scene. How do I prevent this? I just want a solid color background. You don't need to actively say the answer, maybe just link me to a video with the answer.

Here's a node-based solution:

Normal usage. As you can see the blue sky tints all surfaces

Using the Light Path node. The sky is still blue but it becomes invisible to all except the camera


How do you import images onto planes using nodes I have an image and I want to display it on the plane. I searched Google and found that I can use images as planes but if I ever want to change the image I would have to redo the image and all the stuff e.g. modifiers and physics and it's kind of annoying to redo everything so I found out you can use image nodes. I can't seem to find how to put it on the plane.
thanks for any help

There is an add-on that allows you to automatically import an image as a plane:

when you use it to import an image it creates a plane of the right aspect ratio and a shader that displays the image:

If you want to change the image, so long as it has the same aspect ratio, all you have to do is click on the file folder and select a new image.

It can't get any easier than that


How i can bake the entire cloth simulation to shape keys? When I give "apply as the shape key" it seems that it only takes a part of the cloth simulation, I want it to take the whole simulation, my cloth simulation has 200 frames and it seems that in the shape key it has only 20

If you do "Apply as Shape Key" it will create a snapshot of the vertex positions from where you are on the timeline as save that as a shape key. The shape key have no animation data. It interpolates from the base shape key to the cloth shape key linearly. That is, if you place the Value on the Cloth shape key on 0.5, each vertex point will be in between the Base and the Cloth.


Bouncing ball stops bouncing after 250 seconds I have this simple setup of a sphere and a plane. The sphere is animated the first 15 seconds and then the rigid body is turned to dynamic. When the sphere hits the plane it starts bouncing and continues to do that till frame 250 and then stops bouncing (although the animation ends at frame 1000). Why is stopping with bouncing ?

This is because you need to set the Rigid Body Cache end frame to be 1000 instead of 250 as shown below:

Updated .blend file can be found here:


How to demonstrate Archimedes Law in Blender? I would love to demonstrate Archimedes Law in Blender. I understood that it is not possible to have an object float in a fluid because the Blender fluid does not exert a force on an object.

However, is it possible to do this with a particle fluid? Do particles exert a force on an object? Rigid body? Obstacle?

If this is for teaching purposes, you could, instead, illustrate the following thought experiment:

From a perfectly accurate spring scale, dangle an infinitely thin string. The scale shows zero.
Dip the string into a glass of water.The scale still shows zero.
From infinitely thin, weightless material, construct a 1cm cubed box attached to the end of the string, underwater. The scale still shows zero.
Lower the glass. the scale now shows 1 gram.

The upward force on the box of water, while it was submerged, must have been 1 gram.

This, IMO, has the advantage of showing why the law applies, rather than simply demonstrating that Blender can simulate it.


Bug, Bone Constraints are Greyed Out I am learning about bone constraints but have found myself unable to even select them. I started a new file to undo anything that might have contributed to the problem but I am still experiencing this same issue. In the screenshot attached, it is identical to the start up file except I've simply added a single bone. When I navigate to the bone constraints tab and attempt to add one, all of the constraints are greyed out and are unable to be used. Please help.Screenshot

You need to be in Pose mode to have access to the constraints.


Connecting two screws? I'm new to blender and I am looking for an easy way to connect two screws. Currently I have this double helix structure that I made by constructing two screws from circles:
I am looking to connect one of the sides of the double helix like this:

I've tried making a tube using a bezier circle/path but can't find a way to attach it to the ends of the screw easy and seamlessly.

Move both the ends of the helix toward their common centre using proportional editing, then remove doubles and adjust with proportional editing.


Setting the texture's grayscale as alpha? I have the following texture:

I am trying to make a a fading transparency on the part that is black, i could apply this in 3ds max with the "Alpha as gray" option, but i can't seem to do that in blender.

In theory, if i get the material right, it should be basically transaprent in the middle, and blue on the top and bottom, if that makes any sense.
I've been trying playing around with several nodes, with mix and color clamps, but i can't seem to get it right, any suggestions?

Here is the way I would do what I think you're asking. I plugged to color data into a Color Ramp and plugged that into the Alpha channel. There is also a SeparateHSV node that might work well between the Color output and the Color Ramp. For Eevee, you need to go into Settings and set the Blend Mode. In the picture it is set to Alpha Blend.

Another way of doing it is to mix an emission shader and a transparent shader, assuming this is meant as a light. For this screen shot I added another white cube behind the blue object and turned on Eevee's 'bloom'


how to make viewport display diffuse maps in full color? (2.8) I am  painting textures onto 3d meshes so I need to see the color exactly as it is, but in texture paint mode my colors are 100% bright (white is 100%), but in viewport colors get as if it was in lower light (white is like 80%ish grey).

How to make viewport display diffuse maps in full color (like displayed in textures) ?

flat shading is on, still no result.

Managed to experiment the solution out. Here's how:

Rendering tab (evee rendering selected) -> color management -> display device (set to REC709)


How to Set/Calculate pole angle of IK constraint so the chain does not move? How to calculate the exact pole angle so when I add Pole bone the IK chain does not move?

This is what the pole angle is:

Its a signed angle between the Base_Bone's X axis and the projected Pole_axis onto Base_Bone's XZ plane. The direction of projection is IK_axis.

Fill in the bone names, it will print the appropriate pole angle into System console. Then you can set the IK constraint with that Pole bone and angle and the IK chain won't move:

import bpy
from mathutils import *

def signed_angle(vector_u, vector_v, normal):
    # Normal specifies orientation
    angle = vector_u.angle(vector_v)
    if vector_u.cross(vector_v).angle(normal) < 1:
        angle = -angle
    return angle

def get_pole_angle(base_bone, ik_bone, pole_location):
    pole_normal = (ik_bone.tail - base_bone.head).cross(pole_location - base_bone.head)
    projected_pole_axis = pole_normal.cross(base_bone.tail - base_bone.head)
    return signed_angle(base_bone.x_axis, projected_pole_axis, base_bone.tail - base_bone.head)

base_bone = bpy.context.active_object.pose.bones["BASE_BONE_NAME"]
ik_bone = bpy.context.active_object.pose.bones["IK_BONE_NAME"]
pole_bone = bpy.context.active_object.pose.bones["POLE_BONE_NAME"]

pole_angle_in_radians = get_pole_angle(base_bone,
                                       ik_bone,
                                       pole_bone.matrix.translation)
pole_angle_in_deg = round(180*pole_angle_in_radians/3.141592, 3)
print(pole_angle_in_deg)


Is it possible for 2 objects to be attached together but both objects are animated differently? In other words, I am designing a flag that's falling off a tower, and I want to make the cloth part of the flat ripple as it falls while it is attached to the pole which is also falling.

Thats actually really simple. Just Parent your flag to your pole with Ctrl+P. Use pinning in the cloth settings and use Rigid Bodies for the pole or just animate it.


Texture uv map is not applied to the object while I'm following the projection paiting tutorial I don't know what's happened, but after having added a camera and some lamp to the scene, the uv maps that before has been applied correctly to the object, now stopped working. I added an image file on the texture panel and it seems that it has been recognized, but it isn't listed on the material tab. The result is that the object appears always greyish. I attached a lot of pictures, to show you the configuration in the key areas of blender settings:

Here you can see that on the texture panel I selected an image texture

Here you can see that on the material tab the image texture selected on the point 1. is not available.

Here you can see that in edit mode,I see no texture applied to the model

Here you can see that in object mode, I see no texture applied to the model

Instead, in the texture paint mode, I see the texture applied correctly and you can also see how is the configuration settings under the slots tab

Here you can see how is the configuration settings under the tools tab

uv image editor pic

I think there is a little misunderstanding.

At point 1, you are talking about a texture. But at point 2, you are in the material panel. So you wont find your texture here.

An object is rendered with one (or more) material(s). And a material may use an image to render.

As you are using Cycles rendering :

Go to the material tab
Open the "surface" section
Click on the little dot near the color
Choose "Image texture"
Choose or open your image here (you'll have to choose your image by the image's name, not the texture's name : Cycles uses images directly)


Fix angle between two bones Is there any way to keep the angle between two bones fixed?

Here is what I am trying to do. I got an armature consisting of three bones. I IK constrained the tail bone to a dummy and when I move the parent bone, the armature should move in a way that the angle between the middle bone and the tail is fixed. I have tried all kinds of tricky stuff, but couldn't get it work.

Here is what I mean (sorry for the annoying logo!).

Basically, I need the angle between the black bone and yellow bone preserved. It is possible whenever the parent bone (blue) and the IK bone (yellow) rotate "more" so to speak. I mean, it's possible mechanically.

If you don't want to substitute both bones with just one:

Select the Yellow bone and under Inverse Kinematics enable all the locks:

Now it's a rigid piece:


Playing game results in not true colors When I play the game, it doesn't appear with true colors

Original image:

When I play game:

There are no trees and 3D Text is not true color.
What happened?

It looks like you have Stereo enabled and set to Anaglyph. This mode is intended for use with red/cyan 3D glasses, which enables the viewer to perceive depth in the game. See the relevant wikipedia article.

If you don't want this enabled, set it to None in Properties > Render Settings > Stereo:


Show Addon Panel in Sequencer only, not Image Preview I want Bligify's user interface to only appear on the right side of the sequencer in the Video Sequence Editor. Currently it appears in the preview window as well.

It would also be nice if it only appeared in the "Strip" section of the sequencer, not "Modifiers".

The addon's UI is defined like this:

class gif_UI(bpy.types.Panel):
    bl_space_type = "SEQUENCE_EDITOR"
    bl_region_type = "UI"
    bl_label = "Bligify"

I suspect I need to add a line about bl_context, but documentation has not been updated on this.

Bligify shows up in blender like this:

Set bl_category to the tab name you want to use. For example, bl_category = 'Strip'. You can use a new name too, to create a new tab.

To only show your panel in the sequencer and sequencer+preview modes, and not the preview mode, add this to your panel class:

@classmethod
def poll(cls, context):
    return context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}

If you want to have it only in sequencer mode, you can change it to:

@classmethod
def poll(cls, context):
    return context.space_data.view_type == 'SEQUENCER'

PS: I found this bit of code by inspecting the sources of a built-in Blender panel that appears in the sequencer mode and not the preview mode. Just right-click and choose "Edit Source".


Alternative ways of controlling camera, other functions I am new to Blender, and at this point I'm trying to learn how to position the camera in order to see what I'm doing.  The problem is I cannot use the mouse or keyboard.  I have an eye tracking device for mouse control, which also includes an on-screen keyboard.  However, the shortcut hotkeys do not respond to my on-screen keyboard, which is the case for other programs I have used.  In addition, I cannot do a combination of holding a certain key while doing a certain mouse click, or holding down the middle mouse button while dragging.  So I have no way of positioning the camera in some very basic ways.  Are there there are alternative ways of moving the camera, such as using macros like autohotkey?

Go into Camera View Numpad 0.
Enable Lock Camera to View.
Press N or open the Controls Region (or click on the triangle at the top right of the 3D vieport), in the view tab enable Lock Camera to View.

Then you can naviage like you do with other views or using the numeric pad.
Numpad 4 and Numpad 6 will rotate left right.
Numpad 8 and Numpad 2 will rotate up and down
Numpad + and Numpad - willmove the camera forward and back
For Version 7.9:


Vertices WON'T move along axis Okay, so I have this problem I can't seem to find anyone else who does. So I'm trying to move a loop of vertices on the Z axis (First pressing G, then Z) but the problem is that it only LOOKS like it's moving up, but when I rotate the camera it's moved in some odd direction instead. I've also tried inputting the amount I want in to move via the keyboard instead of with the mouse, with the same issue. I've tried this from every angle, to no avail. Any help is much appreciated.

As commented by @RobertGützkow, you have Snapping enabled:

That means your vertices will be snapped to the closest face while moving them. You can disable it altogether or hold CTRL while moving.


How to integrate Zbrush with Blender for long run animation projects? I have years of experience with Zbrush though I am learning blender right now.

I would like to model characters in Zbrush bring them into Blender for animation.

Please let me know what is the best work flow for it. If you can share any tutorial or link for it, even that will help.

I have not found any book which can let me know about this process.

There are many for zbrush and max/ maya but not blender.

Here is a plugin for blender that allows for a very good degree of integration between z-brush and blender.


Can I use an material texture to represent a surface of spheres? I can cover a ball object in particle spheres but this is very processor and memory intensive.

I was wondering if I can use the new voronoi textures in Blender 2.82 to make pseudo spheres around the surface? Obviously it won't achieve the depth effect shown balls image attached.

I'm not sure if I can fake a surface displacement with Dot-product to an emission shader or use displacement in Cycles? I would be keen to try an Eevee normal displacement if its good enough.

Currently I cannot get Voronoi texture to represent moving balls very well.

Use a texture to drive a bump node. Plug Bump's "normal" output into the normal input of the Principled BSDF node. I can make a voronoi texture small enough to represent closely packed balls or bubbles. Then I can colour them as a group with a noisy texture. This hides the fact that each ball is not really coloured. Finally I use a 4D texture to animate the bubbles motion over time.

Here are the nodes :


.obj exportation is not working properly So i this problem with the exportation, the obj file looks fine in the 3d viewer but when I import it in unity it's all wrong, I applied all the modifiers but with no results.I tried to export it as fbx but it's the same.

This is how it should look, I don't know if there is some problem with the mesh but I don't know how to check that.

Nvm I found the answer, it is pretty easy actually. You need to go to the "show overlays" tab (the 3'rd one)

Then press the drop-down and enable "Face Orientation"

After that, all of the faces should blue on the outside and red on the inside.
To inverse them u need to select the wrong ones and go to "Mesh" then "Normals" and "Flip".
(Or Alt+N and Flip)

Also, u can apply a solidify modifier so that u completely hide the red part.
Easy


Carpet coloration specific parts Hi!

I made a carpet and I am looking to add a color on specific part.

I tried brush but it is not satisfaying.

Looking for something like this: https://youtu.be/kv0q6EPJHKk?t=242

Thanks

Answer to Ratt :have you considered Creating a patterned carpet

Thanks very Much. I did not created a new mesh because I wantted to keep this. So I just made a simple texture and add it to the mesh:


Spin tool in Blender 2.92.0 rotates only around z-axis by default The documentation says that the spin tool will extrude faces along an arc rotating around the axis of the viewport. No matter which axis my viewport is oriented to, and no matter where my 3D-cursor is, my spin tool makes an arc around the z-axis. In order to spin around the x- or y-axes, I have to open the Spin menu and type in a 1 for the axis I want and type in a 0 for the z-axis.

Click outside to use view axis.

Spinning around camera view, undo, then TOP ortho.
There may be some magic to using the gizmo that appears if you click a plus, revealing the default Z axis path, but it is a slippery beast and TBH I have no idea how to control it. (apart from moving the pivot point)  Perhaps someone will add a better answer re this..
So I resort to align the view to axis I wish to spin around, then click outside the gizmo and spin around similarly to rotation.


How to Mute Animation Nodes Subprogram Just wonder whether subprograms can be totally muted in ways other than just deleting it. I ask bacause:

For example, I tried to setup a loop in another nodetree, Then disable auto execution for that nodetree. However, it can still be invoked in other nodetrees, because subprograms seem to be kinda "global" data.

In some cases I want to mute the subprogram to improve overall performance by disabling the execution. Is that helpful? Can I do that? Or other better solutions? Thanks!

EDIT: New Version

Same Principle, but how about ditching additional Subprogram and using Get List Element instead:

Old Version

I put actual Subprogram(red) inside another one (blue) as a Parameter to get ability to dynamically change number of iterations. Condition is controling execution of blue Subprogram

New:

Old:


Compositor, blur only parts of a render So here's my render:

and here's my compositor node tree:

The green spheres are on a separate layer from the rest of the ship, so I can apply glow and blur effects to them, without affecting the rest of the ship. Why aren't the green spheres covering the holes in the ship mesh?

I think I fixed the issue by substituting the last Mix node with an Alpha Over node. That appears to have gotten rid of the holes, but I don't know why. If anybody's got either an explanation, or another fix, I'd love to hear it.

Thanks!


Object won't highlight in the 3d viewport This was working fine until I exited blender without saving my file.  When I restarted blender 2.8 and opened my file when I click on an object it highlights in the Scene Collection but not in the 3d Viewport. I am able to manipulate them but I need to see what I have selected.

Jerry

Maybe you deactivated the Outline in the Viewport Overlay? In Object Mode, click the arrow next to the Overlay button (top right) and make sure the box is checked.


when you first import a character, are the materials still there even when in cycle render? I just want to know, because I'm still getting use to this, but when you import a new character with eyes,hair etc. are the material still there in cycles render mode? or do I have to use node and set them up again?

This is how he is Blender render mode, but in cycles render, i only got the skin to show while the eyes and hairs where white. so do you have to find each png or file for those part or can I enable them someway on again?

Cycles an Blender internal work with different material system,means your material in cycles wont work in internal.

There have been some Idea about converting the materials from and to the render engines,like:

Cycles material converter
Convert materials to Cycles


Why is my cube looking like this with the glass material? I'm new at blender and am trying to make the cube look like glass. I'm not sure how to not make it look like a mirror and have this weird texture reflection. The monkey is a better picture with what is going on. It's leaving a reflection of a forest.

No need to overcomplicate things.

Here is how you do it:

Solution 01 (physically accurate)
Use Principled BSDF shader

Leave everything as is (very important)
Set Transmission to 1
Set Roughness as desired
Boom, you have realistic glass.

Solution 02 (old, not physically accurate)
Use Glass BSDF

Set roughness as desired

Example of both, side by side:

Tip:
If you're going for realism, use Principled BSDF wherever you can. It solves many issues for you such as fresnel, light fall-off, etc…

BlenderGuru explains all of it’s nodes.


Project photo onto mesh UV texture I am trying to project an image, taken from a certain angle, onto a mesh.
For the experiment I have a simple box. I was hoping I could use this for more complex geometry, like a 3D scanned room for instance. But first, I would like to make it work with something simple. I'm looking into this because the structore core depth sensors RGB camera is pretty vague and does not provide nice textures.

See the picture below.

And it should be project onto this mesh

I am trying with the UV project modifier on the box, a spot light lamp with an emtpy as its parent. (Like in this example from Blender docs itself.)

I am hoping to get results similar to what is shown in this video on YouTube.

I have been fiddling for quiet some time now, but I cannot seem to get it right. See my attempt below. Then I thought, I am probably not doing it right.

It is possible (doable), if yes, how could I do this?

Thanks so much.

EDIT

So I first wanted to have something simple to experiment with. I made it more simple. I took the variables of the camera. I took a cube, painted something on it and rendered it. Next I tried projecting this exactly on the cube again. It worked! Here is the result. But it took me like 20 minutes or so to align it!

And this was the rendered image.

For your workflow to work, you need the exact match for the camera, both in placement, rotation and perspective. Not a trivial thing to do, and hard and time consuming to do manually.

You can try (Fspy)(https://fspy.io/)
Fspy is an app to match the perspective of a camera in 3d space to a photograph.

Open the Fspy app. and import the image. Set the lines so that you match parallel lines and set the origin where you want it and save the fspy project.

Install the fspy importer addon and then import the fspy project into blender 2.8

Once you open the fspy project, blender will create an active camera that matches the lens and placement of the original camera, and uses an the image as background for reference.

It is then quite easy to create a box that matches your original object.

Then you can unwrap the UV using Project from View.

Create a material that uses the UV map as coordinates for the texture, and the image as color for the shader.

Done. Over and Out.


Layout tab showing a blank rectangle the layout tab only shows a black rectangle.

This is normal if you only have that one texture. Once you create a new texture, or import an image, it will show up in that "black rectangle" and you will be able to use it. For reference: this box is not for shaders, it is for textures.


Animation exported to Unity is always Default Take I have a simple character with three actions: MeleeHit, Walk and Default (one frame on T-pose). I am importing to Unity using the .blend file, not exporting it as FBX. MeleeHit and Default appear as they should on Unity, but Walk is shown as DefaultTake.

I tried to change the name of Walk in Blender and it still was as Default Take in Unity. Even if I delete the animation and create it again with the name "Walk" it will be the Default Take.

I've been trying to figure this out for hours now, if someone could just point me at the right direction I would appreciate.

I think it's also worth mentioning that I'm not an artist (I'm a programmer) so I don't know much about blender.

When you import the model into Unity, a "Default Take" is included in the .FBX. It shouldn't matter if you're directly importing the .blend or .FBX, the default take is created. The default take would include all of the keyframes.

Basically, in Unity you then create additional animations clips (walk, melee), all of these are created based on this Default Take.
When you create additional animation clips in Unity, the source take is usually always the "Default Take", because this is the master source for all animations.

You should end up seeing something like this for the clips:

CLIP           RANGE       SOURCE TAKE
Default Take   0 to 100    Default Take (master take)
Walk           27 to 50    Default Take
MeleeHit       -1 to 26    Default Take


How to exclude passes from EXR file when using the denoiser node? Situation:

Blender: 2.81a, Cycles
1 Scene, 1 View layer

View layer passes:
Combined,
Normal,
Diffuse Color,
Emission

Using the Normal and Diffuse Color as inputs to the denoiser.
Denoiser outputs directly to Composite node.

Want to write to OpenEXR MultiLayer file:

-Compositor output and emission only.

-but not the Normal and Diffuse Color pass.

How to exclude the Normal and Diffuse Color passes from EXR file?

Thanks.

Just plug in the outputs from the Render pass or other nodes that you need directly to the inputs of a File Output node.

EXR multilayer can have any number of arbitrary layers (use the Add input button on the node to create them), so just create the ones you need for further compositing.


how to parent a rigged grop of object using constraints to another object without messing up the constraint i just rigged a fighter jet but forgot to add the engine nozzle to the rig or the empty . so here are the 2 different rigged objects  i want to make them move together so i selected the entire engine parts and parented it to the main rig as expected i just messed it up . i dont want to re do the whole engine again . please tell me how can i parent the 2 sets of objects without messing up with anything .

close observation shows that your flaps control surface all are rigged and are parented to the box empty and it moves along with the rig and what you want is that the engine parts that you have made in another blend file that was imported to the current blend file needs to also follow along with the body . well parenting dosent hold good for these things since it just messes up everything be it the constraints etc .
you can use group instancing over here , heres how
so what you do is first select all the parts of the engine and press ctr g and the press shift a and select group instance you will see a replica of your engine parented to an empty axis use the empty to position the replica in the desired position . and with the  replica selected click on the main empty and parent it  to the empty using keep transform option . now you will see that along with the body the replica engine also moves when you move the empty . now you may notice that all the objects in the replica object look to be joined together to form a single object but you can edit every single object  it by editing the actual engine you can even scale the thrust controller empty and you will notice that even the replica will be able to do the trust vectoring , hope it worked , thanks and bye .


Boolean modifier "conflicts" with Bevel modifier im new here and i have just a question:Im using blender from not a long time (excuse my bad english too),and while i was modelling a PS2 model,i encountered a problem.

I have a Bevel modifier on the upper part(not applied,just there)and it does his work,but as soon as i try to add a Boolean modifier to cut a hole(the P1 controller port) they just act as if they "conflict": I mean,if one is on,the other one doesnt work.Switching them up and down on the modifiers tab shows that only the first one actually takes effect on the mesh.

I tried even applying Bevel first,then cut the Boolean hole but if i do so the hole just doesnt happen.If i apply the Boolean difference,then the Bevel modifier just doesnt work in any way,even deleting and putting a new one.

I will try to upload some screenshot of the part that im talking about.I hope was not a stupid question,but i really cant figure out if i have to find another way or maybe im missing something.If needed i can try upload the file aswell.Thanks in advance

It looks like if you decrease the boolean object's Subdivision Surface subdivisions down to 2, it works, I can't tell you why though:


How can I orient my object to fall the correct way in XNA? I'm trying to export basic shapes from Blender into XNA. We have gravity working in XNA at the moment, but relies on the Y-coordinate being up. So when we export from Blender with the Z-coord up, it either falls the wrong way, or is facing the wrong direction. We would like the shape (pictured) to fall the way it's pictured.

Any advice is appreciated!

The obvious answer is to just rotate your object so that it's oriented as if Z is up. The less obvious part of that is applying your transforms.

Applying transforms is often called normalization and also applies to scale and location. A normalized scale would be 1 and a normalized location would be (0,0,0). Normalized rotation is a little less simple, but essentially it means that your local coordinate system is aligned with your global coordinate system (local x,y,z point the same directions as global x,y,z).

There are two ways to make sure your object is normalized with Z up. One is to do all the rotation in edit mode. This will move the mesh, but leave the local coordinates the way they were.

The (arguably) easier way is to get your object oriented the way you want in object mode, and then (with it still selected) use ctrla and choose the selection for rotation (it'd be a good idea to use this to normalize your scale as well, but that doesn't have anything to do with your question).

In short: rotate your object so that Z is "up," and then apply the rotation.

Hope that helps!


Blender Physics constraint implementation sources I wanted to know where exactly in sources, Blender implements the Bullet Physics for its rigid body constraint solving. That is, where does it pass the arguments such as Rigid Bodies, their orientation, mass, so on in order to set-up the constraint.

Thanks in advance.

The following files contain the implementation of the rigid bodies:

properties_physics_rigidbody.py: UI panels in the physics tab for the Rigid Body
properties_physics_rigidbody_constraint.py: UI panels in the physics tab for the Rigid Body Constraint
rna_rigidbody.c: RNA properties for the rigid bodies.
rigidbody.c: Initialization, copying, validating and freeing data structures for rigid body simulation. Functions for calculating volumes, mass, convex hull. Running and managing the simulation.
rigidbody_world.c: Implements operators that can be called from Python that are related to the rigid body world.
rigidbody_constraint.c: Implements operators that can be called from Python that are related to the rigid body constraint.
rigidbody_object.c: Implements operators that can be called from Python that are related to the rigid body object.
rb_bullet_api.cpp: Wrapper for Bullet Physics functions.

For the parts of code that use the Bullet Physics, search for the WITH_BULLET macro.

Setting the properties and executing the rigid body simulation are separate operations.

Adding a rigid body simulation to an object in the UI results in call to ED_rigidbody_object_add (rigidbody_object.c) which in turn calls BKE_rigidbody_add_object (rigidbody.c). This functions creates the rigid body world by calling rigidbody_add_object_to_scene() (rigidbody.c) in case it doesn't exist and allocates the memory for RigidBodyOb through BKE_rigidbody_create_object() (rigidbody.c) and assigns default values.

For instance the mass property is displayed in the PHYSICS_PT_rigid_body_settings panel (properties_physics_rigidbody.py). It references the RNA property defined in rna_rigidbody.c which calls rna_RigidBodyOb_mass_set() when a new value is assigned through the UI. This stores the value in RigidBodyOb of the object and updates the state of the Bullet Physics through RB_body_set_mass() (rb_bullet_api.cpp).

Adding a rigid body constraint results in a call to ED_rigidbody_constraint_add() (rigidbody_constraint.c). A constraint collection is created if it doesn't already exist. The constraint is created through BKE_rigidbody_create_constraint (rigidbody.c) and added to the constraint collection through BKE_collection_object_add() (rigidbody.c).

When starting the simulation it executes the function BKE_rigidbody_eval_simulation (deg_builder_nodes.cc) which calls BKE_rigidbody_do_simulation (rigidbody.c). It uses the properties for the world, objects and constraints that were previously assigned.

The explanation of the call stack is a simplification of all the operations that happen during configuration and simulation. They are meant as an overview for where certain steps can be found in the code and not a complete explanation of the performed operations.


How to connect value from custom properties to value of object's translate/rotation/scale Sorry I'm new to Blender, came from Maya. Let's say I want to move object A via changing value from object B's custom properties, how can I do it in Blender?
In Maya, there's something called connection editor where basically I can take value from a custom properties/attribute to a translate/rotation/scale or just anything else that able to read said value. I wonder if there's anything like it in Blender or at least nodes for it. Thanks a bunch!

Sure. You can drive the values directly.

Create your custom property (I used a cube)
RMB on the value > Copy as New Driver
Target the other object (I used a Cone)  and RMB > Paste Driver


How can I merge two objects completely? This is only my second sculpture in Blender, so I'm completely a beginner, and I made the body and the head from different objects, because I had to move the head, but now I would like to manipulate them together. What could I do?

Here is a picture of the sculpture:

Join doesn't work, because it's true that they can be moved as one object this way, but they are still two different objects and they aren't merged. I don't want that line between them.

Is there any solution for this problem?

Thank you in advance.

Try using a boolean modifier with Union.


Scale bones not working (ctrl+alt+s) I'm trying to scale my bones but it is not working, i try it in pose mode, edit mode and nothing

you can see it's changing something but no the bone, ScaleB x,y,z always start at 1

In armature settings you need to swich type to B-Bone or Envelope to see the difference.


Error using subprocess to call blender This different from Calling Blender From Python Script in that it concentrates on a different part of the code which results in different error messages. It is also a more clearly stated problem.

I have a very simple python script that I copied from How to Run blender from a python program?

import subprocess
subprocess.call("blender", "proj001-master.blend ")

When I run this, I get the following error message:

  Traceback (most recent call last):
    File "testsubprocess.py", line 2, in
      subprocess.call("blender", "proj001-master.blend ")
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 172, in call
      return Popen(*popenargs, **kwargs).wait()
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 343, in init
      raise TypeError("bufsize must be an integer")
  TypeError: bufsize must be an integer

I changed the code to:

import subprocess
subprocess.Popen("blender", "proj001-master.blend ")

When I run this, I get the following error message:

  Traceback (most recent call last):
    File "testsubprocess.py", line 2, in
      subprocess.Popen("blender", "proj001-master.blend ")
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 343, in init
      raise TypeError("bufsize must be an integer")
  TypeError: bufsize must be an integer

What am I doing wrong here?

Try

subprocess.Popen(["blender", "proj001-master.blend"])


Odd Snake Hook Tool Glitch? Snake Tool is an absolute pain in the butt.

I've looked for this issue everywhere, and I cannot find anything to solve it. I'll admit, I'm new to Blender, but I'm experienced with Photoshop, Sony Vegas, and SFM. Snake Tool grabs both ends of an object, and pulls them. Selecting random parts of the model and pulling them usually results in this distorted, ugly image. I'd appreciate if someone were willing to walk me through and help me solve this issue. Thank you.

That's actually not a glitch. As weird as it looks, the Snake Hook tool is behaving exactly like it should in your case.

To get the tool working as you want it too, your object needs more geometry (more faces/vertices). Sculpting by default only modifies the vertices that your object has. In order to get the tool to pull out a tentacle like shape (like what is shown on the tool icon) you need some way of adding more vertices to your mesh. Currently the brush only affect the dozen or so vertices that are under it when you click. This is not nearly enough to create the shape shown by the brush icon. There are 3 main ways to add more vertices:

Add more vertices manually: This is probably not what you want to do in your case, but one of the ways to add more vertices is to simply add them in edit mode. You could use the loop cut tool (Ctrl+R) or subdivide(W) or some other tool. The reason you dont want to do it this way in your case is because for your object one of the next two ways will be better.
Multiresolution Modifier: The multiresolution modifier works very similar to the subdivision surface modifier in that it subdivides each face (splits it into 4 smaller faces) and then smooths the result. The difference is that the small faces generated by the multires modifier are sculptable, where as they are not for the subsurf modifier. To add a multires modifier, select your object and navigate to the modifier tab in the properties panel (the little wrench in the row of icons near the top left of your screen. Click the add modifier button and select Multiresolution from the Generate column (about halfway down). Then in the modifier option click subdivide as many times as you need to get it as smooth as you want. Just be careful as this modifier can generate a lot of vertices and make blender run slower.
Dynamic Topology: This will probably be what you want to do to get the results you are looking for. In sculpt mode, in the toolbar on the left there will be a panel titled Dyntopo (short for Dynamic Topology). Checking this option will make the Snake Hook tool generate new vertices only where it need them. You may want to adjust the detail size to make it smoother if need be. I would recommend looking up a tutorial that explains sculpting as it will be more thorough than I am here.

If you are new to Blender you are probably going to run into a lot more problems like this, as Blender is sometimes a bit unconventional in how it goes about certain things. There are many good introductory tutorials that can get you up to speed. CG Cookie and BlenderGuru both have excellent introductory series that can help you get started.


How can i fill the U shape face/edge so there will be no empty space? This is my U shape:

And this is how it should be:

It should be filled:

I tried in edit mode to select with B some of the faces then i did in the menu under Extrude: Make Edge/Face but it didn't fill anything and not the whole U shape.

not sure if I missed something but have you tried classic F key to fill faces? Like

edit:

the above is the simplest, but gives you N-gons.

To fill with better topology, try ALTV:

Then, if you need quads, simply convert with ALTJ:

edit2:

cegaton commented about another smart tool, "bridge edge loops"

he's right, so you can also use that like this (note I used it before filling the side faces, otherwise it gave an error):

and you get immediately


Make object circular around one axis I'm sorry if the headline isn't totally perfect but since English isn't my first language it's rather difficult to explain what I try to do right now, so please bear with me. xD
In the pic to be seen is a mesh and inside a sphere. I want the mesh be "circular" around z-axis so it completely surrounds the sphere.
I hope I could make my plan clear. :)
Thanks for the attention.

This question is geometrically unclear.

What do you expect as the final result?

Here are some variations of an answer, that all fit around the sphere.

Can you identify from one of the following?

Don't really have time to answer this, but see what you can glean from this demo. I'm going to have to circle back around to answer properly as time allows.

Quick hint I use Shift+Z when scaling.

My pivot is set to 3d cursor .

Snapping is on and set to Verts.

The rest is extrude and fill.


Blender order of execution I got a test project where I created 2 gauges composed of 20 planes for every 5% each. First one works great and update nicely, second don't even show any planes. I tracked the results with a isVisible boolean parameter where i assign them if the gauge is supposed to be visible or not.

No matter if the object visibility is setted on, nothing appears. I'm wondering if there is a limit of event triggers at the same time in the same scene or something like that

Can you guys help me with this issue?

There was a problem with the objects assigned meshes, like they were visible in designer but not in code behind. So I just erase all planes of my second gauge and copied the first one gauge's planes and assigned the proper value to be used. All work fine now.


How to enable the Alt + right click shortcut (select edge loop) in Lubuntu? On Lubuntu the shorcut Alt + right click moves the entire Blender window instead of selecting edge loops in edit mode. How do i disable the Linux shortcut to use it with Blender.

To disable the shortcut on Lubuntu open the file manager and at the path line copy and past this: ~/.config/openbox/
Open the file lubuntu-rc.xml (you can use Leafpad) and delete the following lines:

  <mousebind button="A-Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
  </mousebind>
  <mousebind button="A-Right" action="Drag">
    <action name="Resize"/>
  </mousebind>

Then save the file, open the terminal (Ctrl+Alt+T) and type this:

sudo openbox --restart


Is MixRGB ALWAYS RGB calculated? Hey guys I'm writing a Quizlet flashcard pack to help people learn and memorize how the various blending modes work within the mixRGB node.

My question is, does mixRGB always handle color inputs as RGB values and not as HSV? What I mean is, blue values in Color1 are only affected by blue values in Color2, correct? Then, when each color channel has been mixed with it's correspondent, the final resulting RGB is outputed. I know that is the way it works for most of the blending types, but are there any loopholes or exceptions that I need to be aware of?

My question is, does mixRGB always handle color inputs as RGB values and not as HSV?

Yes. HSV is somewhat of a crippled colour model.

  I know that is the way it works for most of the blending types, but are there any loopholes or exceptions that I need to be aware of?

Beware because most of them are display referred legacy blend modes conjured up in the dark Adobe days. The math is available in the Adobe PDF specification. They are busted up garbage in a scene referred, physical light transport system.


Best workflow to mix several takes in VSE I'm mixing a music clip of my band in VSE. I've got three takes (1 hour each) of the same show, and I would like to mix them.

Because of the length of the project, I would need a fast way to change the mix of  the three videos, preferably with autokey turned on, and editing while playing.

Any workflow or addon that help me in this task?

Decide on your output framerate first (24, 25, 30, etc). Set that in the render panel and don't ever touch that value again or it will mess up the av sync.
In the timeline window, make sure AV-Sync is turn on. This will help you during preview playback.
Lay down the audio track first, and then lock that layer down with Shift+L.
Turn on the Draw Waveform for the audio track so you can see where the beats are.
Lay down all the video tracks you have, one on each 'layer', and make sure they are in sync with the audio from beginning to end.
Use the Multicam selector to switch between the video tracks.
If the video is in a compressed format with lots of P-frames, you won't be able to scrub through the video smoothly. Consider using the Proxy feature in Blender to generate a smaller, scrubbable version.

Below is a sample of how the setup might look. From the bottom, you see a locked audio track, 3 video-only track, and multicam selectors on the top.

Source: I've edited down 20GBs of footage down to a 4 minutes trailer with VSE before.


How do I emit particles from the opposite normals? I want my particle system to be on the opposite side of my mesh, but I can't flip the normals or that would mess up my other particle systems on the same mesh. How can I emit the particles from the opposite normals?

In order to do this,you can just set the Emitter Geometry's normal value, under the Velocity tab, to a negative number.

Normally, the slider is limited to positive numbers, however, you can just click the middle of the field and type a number in.

Here is a question about this topic:
How can I set sliders to values outside the limits allowed by their slider?


Can't access editing tools in layout workspace Sorry for beginner's question. I sometimes find myself modeling in layout mode and am unable to access any of the tools or select any of the mesh. I must have pressed something or locked something.

Here is what my screen looks like in this situation:

You seem to have unvoluntarily disabled Viewport overlays and gizmos (these are all the contour lines, widgets, grids, basically everything that is not renderable geometry). To re-enable them, press these buttons in the top-right corner of your 3D viewport:

The little arrows next to them let you selectively enable/disable elements.

If that's not your issue, maybe it is that you want to enter the Edit Mode?

There are 3 ways to access it:

On the top-left corner of your screenshot, you can see 'Object Mode'. Click on it and select Edit Mode
While your cursor is on the 3D Viewport and your object(s) is/are selected, hit Ctrl + tab. A pie menu appears: select Edit Mode
Still while your cursor is on the 3D Viewport, hit the tab key : it toggles between Edit and Object mode


Render two layers together for compositing Hello blender community,

I am trying to learn the compositor in blender but I came across a small problem. I placed the environment in the first layer and the sun in the second (sky in both disabled) like you can see in the image.
I renderd both layers together by selecting the two layers.

The problem is that I cannot see the sun in the compositor or when I render both layers together

I did the same thing as the video showed so can somebody help me out?

I looked around in other similar question but that didn't help me

I found the problem.

1) I needed to uncheck "use alpha" in the compositor.
2) add an alpha over to combine two layers.

I only don't understand why?


How to get transform values that would be set from inserting visual key-frame for pose bones? I have some bones with any number of constraints.
I want to get the visual transform matrix of that bones that takes also into account when for example a stretch to constraint modifies that bone.

So basically the output of setting keyframes with Visual LocRotScale setting.

This would be really helpfull for exporting bone data.

The page of PoseBone.matrix says

  Final 4x4 matrix after constraints and drivers are applied (object space)

You can convert the matrix from object space to local space calling Object.convert_space

Edit

The comment of convert_space explicitly states that this can not be used for visual keyframing. For the simplest options with

Inherit Rotation
Inherit Scale

enabled. You can get the local transform for the bone like this

def get_mat_offset(pose_bone):
    """ calculate the (local) rest matrix of the bone
        needs to be multiplied with the parent's pose matrix
        to get the rest matrix in armature space """
    bone = pose_bone.bone
    mat_offset = bone.matrix.to_4x4()
    mat_offset.translation = bone.head.copy()
    mat_offset.translation.y += bone.parent.length
    return mat_offset

pb = obj.pose.bones['Bone.001']

if pb.parent:
    mat_offset = get_mat_offset(pb)
    mat_pose_parent = pb.parent.matrix

    mat_rest_inv = mat_pose_parent * mat_offset
    mat_rest_inv.invert()

    matrix_basis = mat_rest_inv * pb.matrix

else:
    matrix_basis = pb.bone.matrix_local.inverted() * pb.matrix

Further you can decompose the matrix calling mathutils.Matrix.decompose

loc, rot, scale = mat_basis.decompose()


Faces become distorted, strange and look glitchy when looking through camera view Whenever I attempt to create a test render (F12) or when I switch to camera view (Numb 0) my models faces look distorted.  When I'm not looking through camera view, everything is smooth and normal, regardless of how close I am to the objects.  When I switch to these modes the faces become distorted, strange and look glitchy.  I've tried a couple things and have no clue what is causing this or what I can do to fix it.

One possible explanation I came up with is that the models have too much information inside of them, and the render isn't sure what to display.  To solve this, I figured I could delete all of the vertices, faces, etc. inside of the model, but I found no way to do this.  I'm at a loss.

Below is a screenshot from the work window in object mode followed by a screenshot of the camera viewpoint.

It looks like Z-fighting, probably the clip distances is set to a very large number.

The clip range should encompass your scene, not the whole universe. A large clip range will result in lower depth precision, creating Z-fighting, where the render engine cannot determine which surface is in front or which one is behind. In other words blender cannot tell apart faces that are parallel but in close proximity with each other.

For more info read these links:

Shadows along edges of mesh in 3D View

Weird Tears in terrain mesh in Render View only

Weird shading effects when rendering at long distance


Confused with how to stack bpy calls I am calling a script with this command and it fails.

class QuickOrigin(bpy.types.Operator):
    bl_idname = "quick.origin"
    bl_label = "Set Origin"
    bl_options = {'REGISTER'}

    def execute(self, context):
        if bpy.context.mode != 'EDIT_MESH':
            bpy.ops.object.editmode_toggle()
            return{'FINISHED'}

        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.editmode_toggle()
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
        bpy.ops.object.editmode_toggle()
        return{'FINISHED'}

The problem is the "bpy.ops.object.editmode_toggle()" command
after "bpy.ops.object.origin_set(type='ORIGIN_CURSOR')"

Why cannot I just add "bpy.ops.object.editmode_toggle()" in a new line.

But when I do it this way it works.

class QuickOrigin(bpy.types.Operator):
    bl_idname = "quick.origin"
    bl_label = "Set Origin"
    bl_options = {'REGISTER'}

    def execute(self, context):
        if bpy.context.mode != 'EDIT_MESH':
            bpy.ops.object.editmode_toggle()
            return{'FINISHED'}

        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.editmode_toggle()
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

        if bpy.context.mode != 'Object':
            bpy.ops.object.editmode_toggle()
            return{'FINISHED'}
        return{'FINISHED'}

You can avoid the ambiguity of the situation by explicitly setting the object's mode to what you want in each stage:

class QuickOrigin(bpy.types.Operator):
    bl_idname = "quick.origin"
    bl_label = "Set Origin"
    bl_options = {'REGISTER'}

    def execute(self, context):
        if context.object.mode == 'OBJECT':
            bpy.ops.object.mode_set( mode = 'EDIT' )
            return{'FINISHED'}

        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.mode_set( mode = 'OBJECT' )
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
        bpy.ops.object.mode_set( mode = 'EDIT' )
        return{'FINISHED'}


How would I approach creating "fall damage" in the game engine? To  begin, let me clarify this:

Fall damage is environmental damage inflicted upon a player when he falls from a certain height.

In other words, when my players falls from a certain height, I need the player to take damage. I've thought about many different ways to approach this, but none of my approaches worked correctly. If it helps, I have a property that displays velocity, it uses the following: getLinearVelocity().length. Also, I have an object which is above all the floors in my scene. It has the property "floor" to identify it.

How would I approach creating fall damage?

I don't know if you're accepting logic bricks answer, but you can simply have a property on the floor that the player can detect (or in some cases just sense for any collision at all). When the Collision sensor reads false, you can just make the player enter the "fall" state. You should be doing this anyway, so it won't be too hard to add a timer to sense how long the player has been airborne. You want to set it high enough so that the normal jump, or a jump slightly downhill doesn't activate it.

Next, remember, it's not falling that hurts people, but the ground. So when the player hits the ground, before wiping the timer, check the value. If it was over your fall limit, damage the player by a multiple of the remainder. (ie.falls 4 sec. limit was 2.5, multiplier was 3: damage the player by 7 health.) This is reliable, and the more you fall, the more you get damaged. Realistically, you would use an exponential function, but no-one likes falling 10 meters in a game and dying.

In the .blend, practice dropping the man from different heights.


Blender is Lagging Suddenly I just started using blender yesterday. I have been following Blender Guru's donut tutorial, and I have gotten pretty far, but now when I try to sculpt, I can barely see the effect, and when I start using the mouse (I.E. clicking the left mouse key to execute the action of sculpting), the whole application just stops, for a few seconds. Literally, 2 hours ago, It was working fluidly, and now it is too laggy to effectively use. I have seen something about a opengl32.dll file being the problem, but when I searched the computer, I got like, 10 opengl32.dll files, and if I delete them all, it will effect my computer badly, since other applications use them too, and when I visit the blender file, I can't seem to find any opengl32.dll files. My computer has 32gb RAM, and it is only a month or two old, so I hardly think it is a computer issue. I even restarted & updated the computer, and the problem persists.
Like I said, just randomly started lagging, and I can't find anything to help. I also don't really know how to put the system info from blender in this post, as there is not a "file" option from what I can see, but when I searched the document with "ctrl + h" nothing regarding opengl32.dll showed up. I really need to continue learning blender, because I need to make assets for Unreal Engine 4. Pls help.

Never mind, It turns out that due to a subdivision surface modifier, too many vertices were being made, and lagged out the application. By not applying the modifier, it stopped the lag.


How can i join mesh for sculpting I have 2 mesh. I have Boolean operation with union.

The below mesh disappear.

Then i tried with Difference

Got this result

After joining both the mesh i want to sculpt it so that i dont get a edge line between both the mesh where its join. Any suggestion how it works. Thanks

There are two problems with your meshes that is preventing the boolean from working properly.

The normals are reversed on the lower object in relation to how they are set for the upper object. This is what is causing the object to disappear after the boolean. Reverse the normals on the lower object by going into Edit Mode for that object and pressing Shift + n to reverse them.
Each of your objects has edges and faces pinched in certain areas to the point that they are crossing through one another. This also must be changed, or else the boolean will register as successful, but won't actually combine your shapes into one. I fixed the situation by using a smooth modifier on each. But it wasn't quite enough to completely straighten out the faces, so I lightly added a few short strokes in Sclupt Mode with the smooth brush, and all was good.

The included file shows both what the new version of these shapes look like after being tweaked but before being boolean unioned, as well as what they look like after the boolean.


what would be the equivalent tool to this in blender https://help.maxon.net/us/index.html#TOOLMAGNET
it acts like a sculpting brush in blender but u can select faces and only affect them it also has fall off
heres a showcase of the tool compared to soft selection aka proportional editing
https://youtu.be/JArOaI8dC8M?t=791

You can use the "proportional editing" hiding all the part of the mesh (H) you don't want to move.
here the process:


How do you jump through animation keyframes in a loop? How do you jump through animation keyframes in a loop? Currently when using the "jump to keyframe" hotkey the playhead stops on the last keyframe rather than going back to the start.

I can press "Spacebar" to loop an animation but I'd like to loop through keyframes with a hotkey.

I'd also like an answer for the same problem.
My workaround is to press Shift+Left/Right arrow to go to the start/end.
Also setting the automatic play range Ctrl+Alt+P helps. When I press the above hotkeys, it goes to first/last keyframe.


Grease pencil onion skin not showing in draw mode 2.81 but works fine in 2.80 What am I doing wrong?
Using 2.81 Windows 10.
Onion skins do not appear in draw mode, but they do appear in edit and sculpt.
When I load the same file into 2.80 the onion skins appear in draw mode.

As you can see (top image) Onion Skins are checked in Viewport Overlay, and the layer (Mr C) also has onion skins checked, so too are they checked in the materials tab.

And in Blender 2.80 opening the same file (bottom image) the onion skins show.

When I open up a new blank file in 2.81 and draw with grease pencil the onion skin works fine in draw mode.

Here's the .blend file

Thanks.

I realize this is an older question, but I found this while having the same issue. I discovered that for me the problem was that I was in the render preview viewport shading mode. Onion skinning worked in ever viewport shading mode except that one. Hopefully that helps someone else.


How can I keybind the fly navigation camera in 2.8? The fly navigation tool exists in 2.8 Beta, but is only accessible via Search. (This surprises me because it seems pretty finished.) I use it a lot and would like to have quick access to it. In particular, I use it to take videos of work in progress for vlogging, and having to call it with search really puts a crimp in that.

I have looked for it in the Preferences > Keymap section, but I don't see it. I tried under 3dView(Global), I don't see it there. There is a section for View3D Fly Modal, but it only shows how to control it once it is active, not how to start it.

It seems like it must be in there somewhere. Am I missing it somehow? Can I keybind it if it indeed isn't there?

It is in View>Navigation>Fly Navigation

Right click And you have "Assign Shorcut" in menu


rendering a roleplaying map I would like to use blender to model a map of a castle, and then have a cutaway view of the map, with all the objects inside. Then, if possible, have the view almost orthographic.

Yes, I could just illustrate the map using photoshop or illustrator, but I wanted to see if I could use Blender in my pipeline.

How would you go about rendering in Ortho view from top down?

Numpad 7 to go to top view

Numpad 5 to go into orthographic

RMB on your camera

and Ctrl+Alt+Numpad 0

This will move your camera to your view

Now if you F12, you can render whatever your camera is looking at