2
$\begingroup$

I have an object that consists of 2 meshes. To group them, I have added an Empty object and added my 2 objects as children.

I have then put the 3D cursor where I would the origin of the grouped object like to be.

Then I click "Origin to 3D Cursor", but nothing happens. The orange dot stays where it is. I expected it to go where the 3D cursor is.

What am I doing wrong here?

Thank you!

enter image description here

$\endgroup$
4
$\begingroup$

You cannot set the origin for empties. They're just little more than an origin and a world matrix.

For Blender 2.82 and later:

In the header of the 3D View there is a drop down labelled Options. Within you can choose that the transform shall only affect the Parents. Select the empty, press SHIFT+S and click Selection to Cursor to move it to the cursor's location. The location of the children will not be modified.

Affect only

Note that the "affect only" option already exists since Blender 2.81, but the Snap transform didn't support it before commit 3ba5461af0c8b1273d3daf87d050c24a690273be.

For Blender prior to 2.82:

If you want to have the empty at the 3D cursor's location, you will have to position the empty there. It is necessary to remove the parent relationship first ALT+P and add it back afterwards CTRL+P if you don't want the parented objects to move with the empty. With the empty selected, press SHIFT+S and click Selection to Cursor to move it to the cursor's location.

$\endgroup$
5
  • $\begingroup$ Is there a workaround with a large number of empties? I have a CAD import (Navisworks Simulate -> FBX -> blender) with all objects at origin, including three-four levels of empties representing a hierarchy. $\endgroup$
    – Åsmund Hj
    Jun 23 '20 at 10:54
  • $\begingroup$ @ÅsmundHj Depends on what you mean by a workaround. What do you want to do with the empties? There is now an option to only affect the parents, allowing to move the empty without removing the parent-child relationship first. Perhaps it's better if you post a new question for this. $\endgroup$
    – Robert Gützkow
    Jun 23 '20 at 11:12
  • $\begingroup$ I would like to set the origin of all parents to be the a function (average?) of the origins of the children, which I think is the original question. I just have too many of them to do it manually. $\endgroup$
    – Åsmund Hj
    Jun 23 '20 at 16:38
  • $\begingroup$ @ÅsmundHj Please post this as a new question and add an example screenshot showing the hierarchy. I'll take a look. $\endgroup$
    – Robert Gützkow
    Jun 23 '20 at 17:22
  • $\begingroup$ I ended up doing ``` def update_origins_from_children(obj): if obj.type=='EMPTY': barn = list(filter(lambda x: x is not None, [update_origins_from_children(o) for o in obj.children])) antall = len(barn) if antall>0: print(barn[0:4]) total = sum(barn, Vector((0.0,0.0,0.0)) ) nypos = total/antall for barn in obj.children: barn.location-=nypos obj.location=nypos return nypos else: return None else: return obj.location ``` $\endgroup$
    – Åsmund Hj
    Jun 24 '20 at 7:25
0
$\begingroup$

The following python function goes through all empties and moves them based on children origins. (Set mesh origins using Select Hierarchy and Object > Set Origin > Origin to Geometry first)

def update_origins_from_children(obj):
    if obj.type=='EMPTY':
        barn = list(filter(lambda x: x is not None, [update_origins_from_children(o) for o in obj.children]))        
        antall = len(barn)
        if antall>0:
            print(barn[0:4])
            total = sum(barn, Vector((0.0,0.0,0.0)) )
            nypos = total/antall
            for barn in obj.children:
                barn.location-=nypos
            obj.location=nypos
            return nypos
        else:
            return None
    else:
        return obj.location
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.