
The item this is wrapping or None (read-only). Return a quaternion representation of the euler. ReturnsĪ 3x3 rotation matrix representation of the euler. Return a matrix representation of the euler. Rotates the euler a certain amount and returning a unique euler rotationĪxis ( string) – single character in. Other ( Euler, Quaternion or Matrix) – rotation component of mathutils value rotate_axis ( axis, angle ) Rotates the euler by another mathutils value. The rotation order is not taken into account for this function. rotate ( eul ) # often its useful to convert the euler into a matrix so it can be used as # transformations with more flexibility mat_rot = eul. order = 'ZYX' # eulers can be used to rotate vectors vec = mathutils. x ) print ( "Euler Y", eul ) print ( "Euler Z", eul ) # components of an existing euler can be set eul = 1.0, 2.0, 3.0 # components of an existing euler can use slice notation to get a tuple print ( "Values: %f, %f, %f " % eul ) # the order can be set at any time too eul. radians ( 10.0 )) # you can access its components by attribute or index print ( "Euler X", eul. radians ( 45.0 ), 0.0 ), 'XYZ' ) # rotate the euler eul. Import mathutils import math # create a new euler with default axis rotation order eul = mathutils.

This object gives access to Eulers in Blender. True when this object wraps external data (read-only). True when the owner of this data is valid. True when this object has been frozen (read-only). ReturnsĬonvert from CIE XYZ (Illuminant D65) to scene linear color space. ReturnsĬonvert from sRGB to scene linear color space.

ReturnsĬonvert from scene linear to CIE XYZ (Illuminant D65) color space. Return typeĬonvert from scene linear to sRGB color space. ReturnsĪ color in Rec.709 linear color space. Return typeĬolor from_scene_linear_to_rec709_linear ( ) Ĭonvert from scene linear to Rec.709 linear color space. ReturnsĪ color in ACES2065-1 linear color space. ReturnsĬonvert from scene linear to ACES2065-1 linear color space. Return typeĬolor from_rec709_linear_to_scene_linear ( ) Ĭonvert from Rec.709 linear color space to scene linear color space. ReturnsĪ color in scene linear color space. from_aces_to_scene_linear ( ) Ĭonvert from ACES2065-1 linear to scene linear color space. freeze ( ) Īfter this the object can be hashed, used in dictionaries & sets. Use this to get a copy of a wrapped color with Color (( 0.25, 0.0, 0.0 )) # Color can be multiplied, in this example color is scaled to 0-255 # can printed as integers print ( "Color: %d, %d, %d " % ( col * 255.0 )) # This example prints the color as hexadecimal print ( "Hexadecimal: %.2x%.2x%.2x " % ( int ( col. r ) print ( "Color G:", col ) print ( "Color B:", col ) print ( "Color HSV: %.2f, %.2f, %.2f ", col ) # components of an existing color can be set col = 0.0, 0.5, 1.0 # components of an existing color can use slice notation to get a tuple print ( "Values: %f, %f, %f " % col ) # colors can be added and subtracted col += mathutils. s *= 0.5 # you can access its components by attribute or index print ( "Color R:", col. Color (( 0.0, 0.0, 1.0 )) # as well as r/g/b attribute access you can adjust them by h/s/v col. 3d matrices are better, but quaterions are the new prefered cutting edge method of working with transforms…MUCH faster and more efficient.Import mathutils # color values are represented as RGB values from 0 - 1, this is blue col = mathutils.

Unfortunately you cannot write to transforms in Maya like you can in Max.Įxporting Euler data is a very old, simple and sloppy way of handling data. So converting from one to the other is as simple as shifting data around the 3d matrices. Maya and Max handle transformation matrices very differently, they both use matrices, but the elements are setup different in each respective matrix. I tell them to dump the transforms on a per frame basis, if they can use a b-spline compression alogrythm cool, if not then at the very least they should just sample the transform values. There is no way to identify what kind of controller an animator may want to use, and in a lot of cases the controllers are list or scripted. I tell all programmers to stay away from controller “values” for data being exported.
