0

The answer to the above question seems to involve moving the scene cursor to the selected face, performing some matrix magic (math) and at one point using bpy.ops.object.origin_set without ruining said matrix magic.

Any chance that anyone has done this before, or know the actual math required for it?

NOTE: My objects are not at the origin and may be rotated already!

eobet
  • 334
  • 2
  • 11
  • 1
    Related https://blender.stackexchange.com/questions/140605/setting-meshs-origin-in-python-2-8 https://blender.stackexchange.com/questions/35825/changing-object-origin-to-arbitrary-point-without-origin-set https://blender.stackexchange.com/questions/183552/how-to-have-an-object-lie-on-a-specific-face/183724#183724 https://blender.stackexchange.com/questions/177889/calculating-and-exporting-global-rotation-of-faces-created-from-splitting-an-iso/177913#177913 – batFINGER Mar 08 '21 at 21:34
  • Thanks, yes, I'm also looking at this one: https://blender.stackexchange.com/a/209798/38603 – eobet Mar 08 '21 at 21:39
  • Would you say it's a Possible duplicate? – batFINGER Mar 08 '21 at 21:46
  • If I can get some of the answers to work, but so far, I can't get the math to work out. For example, the link I pasted only works if the object is at the origin, which mine are not (so I added an edit to clarify that in the question above). – eobet Mar 08 '21 at 21:58
  • NOTE. re bumps and in regard to comments here it is a simple process to move an object to origin by multiplying by its matrix world inverted. Apply any code that works at origin while object is there, then transform back. Still think this has been well covered AND IMO is if not a dupe, a combination of two dupes. Please consider editing the specifics of what you are having difficulty with into question. – batFINGER Mar 14 '21 at 16:45

0 Answers0