diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-06-21 02:55:18 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-06-21 02:55:18 +0400 |
commit | 207911bdb3e5ba3e110cc7107186af988d2d10e8 (patch) | |
tree | 88684071e2813d52f8dc700b593d7644b2be88c8 /release/scripts/modules | |
parent | adb81a0351c0854ee8529ae7a66ef9c907790ee5 (diff) | |
parent | 768184753abb5a69e278bfe6207fe070b2e0ffc7 (diff) |
Merge with trunk r37677
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy_extras/mesh_utils.py | 1 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_types.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 14 |
4 files changed, 15 insertions, 6 deletions
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index b6d8a1fcf16..e026910fb43 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -267,6 +267,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True): fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly. ''' + from mathutils.geometry import tesselate_polygon from mathutils import Vector vector_to_tuple = Vector.to_tuple diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index 45f537ebd2f..f2f2e53240b 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -114,6 +114,8 @@ def location_3d_to_region_2d(region, rv3d, coord): :return: 2d location :rtype: :class:`Vector` """ + from mathutils import Vector + prj = Vector((coord[0], coord[1], coord[2], 1.0)) * rv3d.perspective_matrix if prj.w > 0.0: width_half = region.width / 2.0 diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index c30c893c9cc..c33ec2df86f 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -20,7 +20,6 @@ from _bpy import types as bpy_types import _bpy -from mathutils import Vector StructRNA = bpy_types.Struct.__bases__[0] StructMetaPropGroup = _bpy.StructMetaPropGroup @@ -144,18 +143,21 @@ class _GenericBone: def x_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((1.0, 0.0, 0.0)) * self.matrix.to_3x3() @property def y_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((0.0, 1.0, 0.0)) * self.matrix.to_3x3() @property def z_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((0.0, 0.0, 1.0)) * self.matrix.to_3x3() @property diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 9311987e2e7..b0fb3b66d0a 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -111,12 +111,16 @@ def draw(layout, context, context_member, property_type, use_edit=True): continue row = layout.row() - convert_to_pyobject = getattr(val, "convert_to_pyobject", None) + to_dict = getattr(val, "to_dict", None) + to_list = getattr(val, "to_list", None) val_orig = val - if convert_to_pyobject: - val_draw = val = val.convert_to_pyobject() - val_draw = str(val_draw) + if to_dict: + val = to_dict() + val_draw = str(val) + elif to_list: + val = to_list() + val_draw = str(val) else: val_draw = val @@ -131,7 +135,7 @@ def draw(layout, context, context_member, property_type, use_edit=True): row.label(text=key) # explicit exception for arrays - if convert_to_pyobject and not hasattr(val_orig, "len"): + if to_dict or to_list: row.label(text=val_draw) else: if key in rna_properties: |