-
Notifications
You must be signed in to change notification settings - Fork 68
Transformations
[ improvement needed ]
Multipurpose functions provides a range of features in one command, depending on what argument you provide them. This means the following functions can be used to both get and set transformation data on objects.
This function is used to set or get the location of a provided object.
- If only
ref
is provided, it will return the location of the object. - If both
ref
andloc
are provided, then it will set the location of the object to the location provided (expects a list of 3 values for X, Y and Z). - If only
loc
is provided, then it will set the location of the actively selected object (found withactive_object()
) to the provided location. - If no arguments are provided, then it will get the location of the actively selected object (found with
active_object()
).
Parameters :
- ref (String Name | Reference) : Object reference
- loc (Vector) : Coordinates of point in global space represented by list of 3 values
Returns : None | Vector Location
This function is used to set or get the rotation of a provided object.
- If only
ref
is provided, it will return the rotation of the object. - If both
ref
androt
are provided, then it will set the euler rotation of the object to the rotation provided (expects a list of 3 values for X, Y and Z). - If only
rot
is provided, then it will set the euler rotation of the actively selected object (found withactive_object()
) to the provided rotation. - If no arguments are provided, then it will get the euler rotation of the actively selected object (found with
active_object()
).
Parameters :
- ref (String Name | Reference) : Object reference
- rot (Euler) : Euler rotation to be assigned to object
Returns : None | Euler Rotation
- If only
ref
is provided, it will return the scale of the object. - If both
ref
andscale
are provided, then it will set the scale of the object to the scale provided (expects a list of 3 values for X, Y and Z). - If only
scale
is provided, then it will set the scale of the actively selected object (found withactive_object()
) to the provided scale. - If no arguments are provided, then it will get the scale of the actively selected object (found with
active_object()
).
Parameters :
- ref (String Name | Reference) : Object reference
- scale (Vector) : Scaling Vector
Returns : None | Vector Scale
Applies the location of the object. The equivalent of calling bpy.ops.object.transform_apply(location=True, rotation=False, scale=False)
.
Parameters :
- ref (String Name | Reference) : Object reference
Applies the rotation of the object. The equivalent of calling bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
.
Parameters :
- ref (String Name | Reference) : Object reference
Applies the scale of the object. The equivalent of calling bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
.
Parameters :
- ref (String Name | Reference) : Object reference
Applies the location, rotation and scale of the object. The equivalent of calling bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
.
Parameters :
- ref (String Name | Reference) : Object reference
Applies the rotation and scale of the object. The equivalent of calling bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
.
Parameters :
- ref (String Name | Reference) : Object reference
Translates objects by given vector in global coordinates
Parameters :
- vec* (Vector) : List of 3 values or mathutils.Vector
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Translates ref
objects by val
along global axis
specified with a list of 3 values.
Parameters :
- val* (float) : Value
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_axis(val, axis, ref)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_x(val, ref)
- translate_along_global_x(val, ref)
- move_along_global_x(val, ref)
- translate_in_x(val, ref)
- move_in_x(val, ref)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_y(val, ref)
- translate_along_global_y(val, ref)
- move_along_global_y(val, ref)
- translate_in_y(val, ref)
- move_in_y(val, ref)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_z(val, ref)
- translate_along_global_z(val, ref)
- move_along_global_z(val, ref)
- translate_in_z(val, ref)
- move_in_z(val, ref)
Parameters :
- val* (float) : Value
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_local_x(val, ref)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions :
- move_along_local_y(val, ref)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Convenience functions:
- move_along_local_z(val, ref)
Parameters :
- vec* (Vector) : List of 3 values or mathutils.Vector
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Rotates ref
objects by deg
arounf global axis
specified with a list of 3 values, about pivot point
Parameters :
- deg* (float) : Angle
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions :
- rotate_around_x(deg, ref, point)
- rotate_in_x(deg, ref, point)
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions:
- rotate_around_y(deg, ref, point)
- rotate_in_y(deg, ref, point)
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions:
- rotate_around_z(deg, ref, point)
- rotate_in_z(deg, ref, point)
Parameters :
- deg* (float) : Angle
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- deg* (float) : Angle
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Scaling functions work in local coordinates by default.
Scale ref
objects by vec
vector (list of 3 vales) in respective local axis
Parameters :
- vec* (Vector) : List of 3 values or mathutils.Vector
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Scale ref
objects uniformly by val
in local axes
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
Scale ref
objects by vel
local axis
specified with a list of 3 values, about pivot point
Parameters :
- val* (float) : Value
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction of local axis
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions :
- scale_along_local_x(val, ref, point)
- scale_in_x(val, ref, point)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions :
- scale_along_local_x(val, ref, point)
- scale_in_x(val, ref, point)
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Convenience functions :
- scale_along_local_x(val, ref, point)
- scale_in_x(val, ref, point)
Parameters :
- val* (float) : Value
- axis* (Vector) : List of 3 values or mathutils.Vector to represent direction of local axis
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
A behaviour similar to S > Shift + X
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
A behaviour similar to S > Shift + Y
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point
A behaviour similar to S > Shift + Z
Parameters :
- val* (float) : Value
- ref (String Name | Reference | List) : Accepts a string name or object reference. Can also accept lists of names or references.
- point (Vector) : List of 3 values or mathutils.Vector to represent pivot point