I've been running through the forums and documentation, and would appreciate any help! I want to offset the rotation of an object by [Vector3(X, Y, Z)]
I need to add or subtract the "radians" consistently across multiple scenes
The juice of the code I'm struggling with is here:
#move the new obj to the original ob.location = (ob2.location + mathutils.Vector(list_PosOffset[int_ListLength-1]) ) #assign rotations to be Euler XYZ ob.rotation_mode = 'XYZ' ob2.rotation_mode = 'XYZ' #match the original object's rotation ob.rotation_euler = ob2.rotation_euler #Ammend the rotation (+180, +0, -90) #???? I've tried with Euler, Quaternion, and AxisAngle... I'm not sure I understand matrices enough
Everything else is working, but after I make 2 objects' pivots line up, I'm having trouble;
- adding 180 degrees to whatever the X rotation is
- subtracting 90 degrees from whatever the Y rotation is.
If it helps, here's the goal of my script .
INTRO Compare objects replace script is intended to two dictionaries/libraries of objects and arrange them to match up and offset the pivots. Unfortunately many of the pivot offsets are unique, and with 105 instances of this issue, it is ideal to solve this problem with a script.
WHAT SHOULD THIS DO
- This script will take 2 lists of all the object names available (manual lits atm)
- Then it will loop through each object from the main list
a) it will look for it's matched partner in the 2nd list
b) it will move to that object's pivot
c) it will make (manual) adjustments based on the offset
d) it will delete the 2nd object
- After all objects are correctly placed, it will select all objects and export them NOTE: The script may need a step to import scenes (as I don't want to import 105 meshes)