mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Examples were supported with/without number suffix, this caused problems using mypy for type checking because it attempted to resolve imports such as `mathutils` to the example file. Having only some examples numbered already complicated documentation for conventions with examples - simplify extraction and number all.
10 lines
324 B
Python
10 lines
324 B
Python
# Compute local object transformation matrix:
|
|
|
|
import bpy
|
|
import mathutils
|
|
|
|
obj = bpy.context.object
|
|
if obj.rotation_mode == 'QUATERNION':
|
|
matrix = mathutils.Matrix.LocRotScale(obj.location, obj.rotation_quaternion, obj.scale)
|
|
else:
|
|
matrix = mathutils.Matrix.LocRotScale(obj.location, obj.rotation_euler, obj.scale)
|