1
$\begingroup$

I opened an old large project I worked on as a newbie and I wanted to clean up a batch of objects, removing excess faces, edges, vertices as well as fixing the normals. In order to copy the cleaned object to another location (replacing another object and in the provided example another column support), I need to figure out how 2 separate objects in 2 separate displayed locations is showing the same location, orientation, scale and origin.

I noticed this anomaly when I tried to link my corrected object with a incorrectly modeled object. Selecting SupportOnly.005 object then shift selecting SupportOnly.004 then pressing Ctrl+L then Link Object Data as per: Is there any way to replace an object?

Maybe not necessary for non-coders but here's python code on how I found out both objects had the same above data:

import bpy
print("")
print("------START-------")

active_object = bpy.context.active_object
selected_objects = bpy.context.selected_objects

print("Selected objects:")
for item in selected_objects:
    print(item.name)
    print(f"  Location: ({item.location.x}, {item.location.y}, {item.location.z})")
    print(f"  Orientation: ({item.rotation_euler.x}, {item.rotation_euler.y}, {item.rotation_euler.z})")
    print(f"  Scale: ({item.scale.x}, {item.scale.y}, {item.scale.z})")
    print(f"  Origin: ({item.matrix_world.to_translation().x}, {item.matrix_world.to_translation().y}, {item.matrix_world.to_translation().z})")
print("------DONE-------")

and this is the result

------START-------
Selected objects:
SupportsOnly.004
  Location: (-0.0012478828430175781, 0.0014386177062988281, 0.0)
  Orientation: (0.0, -0.0, -0.00023472122848033905)
  Scale: (1.0, 1.0, 1.0)
  Origin: (-0.0012478828430175781, 0.0014386177062988281, 0.0)
SupportsOnly.005
  Location: (-0.0012478828430175781, 0.0014386177062988281, 0.0)
  Orientation: (0.0, -0.0, -0.00023472122848033905)
  Scale: (1.0, 1.0, 1.0)

Thanks for any help or tips.

Example file download: https://drive.google.com/file/d/1IVcYJrbPXnD3nH6kXYHey-8EZ7Jxm3sJ/view?usp=sharing

Solution: Thanks for the background and solution @moonboots!

The problem was that the origin of each object of the file is not located at the center of each mesh but rather at the same point. It began when I separated the building support object into multiple separate objects (P->Separate), after doing so, I needed to set origin to geometry (Right click > Set Origin > Origin to Geometry) for each object.

Details:

The key thought here is the visual display in the viewport is a calculation of the geometric properties of the mesh (such as vertex locations) and the transform properties of the object (such as location, orientation, scale, and origin).

Example Model: Example Support Post Model

$\endgroup$
9
  • 2
    $\begingroup$ The origins of the 4 objects are at the same location (almost at the center of the scene), that's why they share the same location $\endgroup$
    – moonboots
    Commented Nov 28, 2023 at 17:18
  • $\begingroup$ @moonboots, can you explain that another way? Are you saying that the example objects are such a small fraction apart so the order of magnitude displayed in the panels and python isn't showing this minute difference? $\endgroup$
    – PPL
    Commented Nov 28, 2023 at 17:27
  • $\begingroup$ the origin of each object of the file is not located at the center of each mesh, it's far away, and for some reason they are all at the same location, but you can change the origin location with a right click > Set Origin > Origin to Geometry $\endgroup$
    – moonboots
    Commented Nov 28, 2023 at 17:33
  • $\begingroup$ @moonboots, jackpot. Both had origins at a central point on the floorplan. Would you happen to know how it calculates the position on the viewport if it seems all the object data relative to position was the same on both objects? $\endgroup$
    – PPL
    Commented Nov 28, 2023 at 17:51
  • $\begingroup$ I'm not sure what you mean, the thing that probably happened is that you had one object with these different meshes and at what point you separated each mesh as a separate object (P > Separate), but this operation doesn't realign each origin to the geometry of each object, it keeps it where it was when the meshes were part of the same object $\endgroup$
    – moonboots
    Commented Nov 28, 2023 at 17:56

1 Answer 1

1
$\begingroup$

What probably happened is that you had an object with several meshes inside and at one point you've separated these meshes with a P > Separate Selection:

enter image description here

The result is that you have now 2 (or more) objects, but the origin stays where it was before the separate operation, so as long as you don't move these objects the origins will still overlap. As the Location of the object depends on the origin position in the 3D scene, these objects share the same Location, even though their mesh are not overlapping. If you want the origin to be placed at the center of the mesh geometry, in Object mode right click and > Set Origin > Origin to Geometry.

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .