1

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

PPL
  • 175
  • 7
  • 2
    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 – moonboots Nov 28 '23 at 17:18
  • @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? – PPL Nov 28 '23 at 17:27
  • 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 – moonboots Nov 28 '23 at 17:33
  • @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? – PPL Nov 28 '23 at 17:51
  • 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 – moonboots Nov 28 '23 at 17:56
  • @moonboots, yes I did separate them. What still isn't making sense is how does Blender calculate where each object displays in the viewport. If Blender was only using 4 data fields [location, orientation, scale and origin] then both objects would be displayed over each other. – PPL Nov 28 '23 at 18:19
  • i think you are confusing object and mesh, an object is like an empty box that is defined by an origin and some transformation data (loc/rot/scale), the object can contain a mesh or another one, but the mesh can be far away from the origin – moonboots Nov 28 '23 at 18:22
  • @moonboots. Yes. Thanks I am confusing both. The problem then is in the mesh vertices in relation to the world origin as per your suggestion. Thus if the 8 vertices of the rectangular cube is linked (via Ctrl+L) it's not really copying over the objects origin but the mesh data. – PPL Nov 28 '23 at 18:24
  • If you link the object data via Ctrl L, the object will keep its own origin but it will get the same mesh as the active object, if the origin of the 2 objects are overlapping, the meshes will overlapping as well – moonboots Nov 28 '23 at 18:32

1 Answers1

1

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

moonboots
  • 155,560
  • 7
  • 105
  • 171