Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy_types.py
| Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | def transform(self, matrix, scale=True, roll=True): | ||||
| :type roll: bool | :type roll: bool | ||||
| """ | """ | ||||
| from mathutils import Vector | from mathutils import Vector | ||||
| z_vec = self.matrix.to_3x3() * Vector((0.0, 0.0, 1.0)) | z_vec = self.matrix.to_3x3() * Vector((0.0, 0.0, 1.0)) | ||||
| self.tail = matrix * self.tail | self.tail = matrix * self.tail | ||||
| self.head = matrix * self.head | self.head = matrix * self.head | ||||
| if scale: | if scale: | ||||
| scalar = matrix.median_scale | scalar = matrix.mean_scale | ||||
| self.head_radius *= scalar | self.head_radius *= scalar | ||||
| self.tail_radius *= scalar | self.tail_radius *= scalar | ||||
| if roll: | if roll: | ||||
| self.align_roll(matrix * z_vec) | self.align_roll(matrix * z_vec) | ||||
| def ord_ind(i1, i2): | def ord_ind(i1, i2): | ||||
| ▲ Show 20 Lines • Show All 601 Lines • Show Last 20 Lines | |||||