2.8: update for x_ray and draw/display renaming.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 3 Sep 2018 17:03:06 +0000 (19:03 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Sep 2018 11:02:59 +0000 (13:02 +0200)
io_import_voodoo_camera.py
io_scene_cod/import_xmodel.py
io_scene_fpx/fpx_import.py
mesh_ktools.py
mesh_xoffsets.py
np_station/utils_graphics.py
object_particle_hair_lab.py
space_view3d_enhanced_3d_cursor.py
space_view3d_toolshelf_menu.py

index f3fac30cae3dab2379f6100df89bedf4236c33bc..8072db8ab845eed0a0c1cf8929f905e1af9fdc42 100644 (file)
@@ -81,7 +81,7 @@ def voodoo_import(infile,ld_cam,ld_points):
         data.dof_distance = 0.0
         data.clip_start = 0.1
         data.clip_end = 1000.0
-        data.draw_size = 0.5
+        data.display_size = 0.5
         scene.objects.link(vcam)
         vcam.parent = dummy
 
index 6f862e0b300e8650316491dc09daf4d4b2756852..a643d1b39d43e195303d4d89bb1ced86ae220df8 100644 (file)
@@ -299,7 +299,7 @@ def load(self, context, filepath=""):
         enter_editmode=True,
         location=origin)
     ob = bpy.context.object
-    ob.show_x_ray = True
+    ob.show_in_front = True
     ob.name = name
     amt = ob.data
     amt.name = name + "Amt"
@@ -351,7 +351,7 @@ def createRig(context, name, origin, boneTable):
         enter_editmode=True,
         location=origin)
     ob = bpy.context.object
-    ob.show_x_ray = True
+    ob.show_in_front = True
     ob.name = name
     amt = ob.data
     amt.name = name + "Amt"
index f9351db82d61d66db5a9e1575d2f38c9094ebdb4..42cea23626a8d4b8bb69ba2d982ba56ad3969505 100644 (file)
@@ -827,8 +827,8 @@ class FptImporter():
                             blender_empty_object.location = blender_position
                             blender_empty_object.rotation_mode = 'XZY'
                             blender_empty_object.rotation_euler = blender_rotation
-                            blender_empty_object.empty_draw_type = 'ARROWS'
-                            blender_empty_object.empty_draw_size = 10.0
+                            blender_empty_object.empty_display_type = 'ARROWS'
+                            blender_empty_object.empty_display_size = 10.0
                             self.__scene.objects.link(blender_empty_object)
                             blender_empty_object.layers = layers
 
@@ -985,7 +985,7 @@ class FptImporter():
         camera.clip_start = 1.0 # 1.0mm
         camera.clip_end = 10000.0 # 10.0m
         camera.dof_distance = 1211.0
-        camera.draw_size = 100.0
+        camera.display_size = 100.0
         self.__scene.camera = obj
         for area in self.__context.screen.areas:
             if area.type == 'VIEW_3D':
@@ -2018,8 +2018,8 @@ class FptImporter():
             blender_empty_object.rotation_mode = 'XZY'
             v = (cu.splines[-1].bezier_points[0].handle_left - cu.splines[-1].bezier_points[0].co)
             blender_empty_object.rotation_euler = Euler((0, 0, Vector((v.x, v.y)).angle_signed(Vector((1.0, 0.0)))), 'XZY')
-            blender_empty_object.empty_draw_type = 'ARROWS'
-            blender_empty_object.empty_draw_size = 10.0
+            blender_empty_object.empty_display_type = 'ARROWS'
+            blender_empty_object.empty_display_size = 10.0
             self.__scene.objects.link(blender_empty_object)
             blender_empty_object.fpt.name = FORMAT_EMPTY_OBJECT.format(FORMAT_MODEL_START.format(name))
             if fpx_id:
@@ -2035,8 +2035,8 @@ class FptImporter():
             blender_empty_object.rotation_mode = 'XZY'
             v = (cu.splines[-1].bezier_points[-1].handle_right - cu.splines[-1].bezier_points[-1].co)
             blender_empty_object.rotation_euler = Euler((0, 0, Vector((v.x, v.y)).angle_signed(Vector((1.0, 0.0)))), 'XZY')
-            blender_empty_object.empty_draw_type = 'ARROWS'
-            blender_empty_object.empty_draw_size = 10.0
+            blender_empty_object.empty_display_type = 'ARROWS'
+            blender_empty_object.empty_display_size = 10.0
             self.__scene.objects.link(blender_empty_object)
             blender_empty_object.fpt.name = FORMAT_EMPTY_OBJECT.format(FORMAT_MODEL_END.format(name))
             if fpx_id:
@@ -2133,8 +2133,8 @@ class FptImporter():
             blender_empty_object.rotation_mode = 'XZY'
             v = (bezier_point.handle_right - bezier_point.co)
             blender_empty_object.rotation_euler = Euler((0, 0, Vector((v.x, v.y)).angle_signed(Vector((1.0, 0.0)))), 'XZY')
-            blender_empty_object.empty_draw_type = 'ARROWS'
-            blender_empty_object.empty_draw_size = 10.0
+            blender_empty_object.empty_display_type = 'ARROWS'
+            blender_empty_object.empty_display_size = 10.0
             self.__scene.objects.link(blender_empty_object)
             blender_empty_object.fpt.name = FORMAT_MODEL_RING.format(name, index)
             if fpx_id:
@@ -2629,8 +2629,8 @@ class FptImporter():
             blender_empty_object_new.location = old_object.parent.location + old_object.location + offset
             blender_empty_object_new.rotation_mode = blender_empty_object.rotation_mode
             blender_empty_object_new.rotation_euler = Euler((0, 0, radians(angle)), blender_empty_object.rotation_mode)
-            blender_empty_object_new.empty_draw_type = blender_empty_object.empty_draw_type
-            blender_empty_object_new.empty_draw_size = blender_empty_object.empty_draw_size
+            blender_empty_object_new.empty_display_type = blender_empty_object.empty_display_type
+            blender_empty_object_new.empty_display_size = blender_empty_object.empty_display_size
             self.__scene.objects.link(blender_empty_object_new)
 
             old_group_dict = {}
index 73b61f3be6538d4669eca22dc6be67b13d9bb9eb..418df8107090149cdd15bdbf21a13de1966a117a 100644 (file)
@@ -564,7 +564,7 @@ class quickbool(bpy.types.Operator):
                                         bpy.ops.object.select_pattern(pattern=name)
                                         bpy.context.scene.objects.active = bpy.data.objects[name] 
 
-                                        bpy.context.object.draw_type = 'WIRE'
+                                        bpy.context.object.display_type = 'WIRE'
                                         
                                         # Move to garbage layer
                                         if move_to == True:
index 4da6cf19c01f2a3a1ed315ce93256e7fa35622cc..4897558362cc24c84176665a97ec64da58a0f15f 100644 (file)
@@ -1278,12 +1278,10 @@ def exit_addon(self):
 def check_for_reg_overlap(self):
     system = bpy.context.user_preferences.system
     if system.use_region_overlap:
-        # other draw_method options don't create transparent side bars
-        if system.window_draw_method in ('TRIPLE_BUFFER', 'AUTOMATIC'):
-            area = bpy.context.area
-            for r in area.regions:
-                if r.type == 'TOOLS':
-                    self.rtoolsw = r.width
+        area = bpy.context.area
+        for r in area.regions:
+            if r.type == 'TOOLS':
+                self.rtoolsw = r.width
 
 
 def draw_callback_px(self, context):
index e71160a495f77f388a2ce8a4331b3852033bc980..884318ea02db28a2ae3099b3fb9b5aa1fa638e0b 100644 (file)
@@ -151,19 +151,17 @@ def display_instructions(region, rv3d, instruct, keys_aff, keys_nav, keys_neg):
     rwtools = 0
     rwui = 0
 
-    np_print(system.window_draw_method, system.use_region_overlap)
+    np_print(system.use_region_overlap)
 
 
     if system.use_region_overlap:
-        if system.window_draw_method in ('TRIPLE_BUFFER', 'AUTOMATIC') :
-
-            area = bpy.context.area
-            np_print('GO', area.regions)
-            for r in area.regions:
-                if r.type == 'TOOLS':
-                    rwtools = r.width
-                elif r.type == 'UI':
-                    rwui = r.width
+        area = bpy.context.area
+        np_print('GO', area.regions)
+        for r in area.regions:
+            if r.type == 'TOOLS':
+                rwtools = r.width
+            elif r.type == 'UI':
+                rwui = r.width
 
     np_print('rwtools', rwtools, 'rwui', rwui)
     field_keys_y = 46
index e628e862b1fb30b5a2d8798c083b49a185c1139f..08b0815f1a94e01855400888b3ca482ba42bb9b1 100644 (file)
@@ -155,7 +155,7 @@ class testScene2(bpy.types.Operator):
         bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
         cam = bpy.context.active_object.data
         cam.lens = 50
-        cam.draw_size = 0.1
+        cam.display_size = 0.1
 
 # add spot lamp
         bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
@@ -296,7 +296,7 @@ class Generategrass(bpy.types.Operator):
             grassParticles.settings.use_hair_bspline = True
             grassParticles.settings.render_step = 5
             grassParticles.settings.length_random = 0.5
-            grassParticles.settings.draw_step = 5
+            grassParticles.settings.display_step = 5
 # children
             grassParticles.settings.rendered_child_count = 50
             grassParticles.settings.child_type = "INTERPOLATED"
@@ -408,7 +408,7 @@ class Generategrass(bpy.types.Operator):
             grassParticles.settings.use_hair_bspline = True
             grassParticles.settings.render_step = 7
             grassParticles.settings.length_random = 1.0
-            grassParticles.settings.draw_step = 2
+            grassParticles.settings.display_step = 2
 # children
             grassParticles.settings.child_type = "INTERPOLATED"
             grassParticles.settings.child_length = 0.160
@@ -501,7 +501,7 @@ class Generategrass(bpy.types.Operator):
             grassParticles.settings.use_hair_bspline = True
             grassParticles.settings.render_step = 3
             grassParticles.settings.length_random = 0.3
-            grassParticles.settings.draw_step = 3
+            grassParticles.settings.display_step = 3
 # children
             grassParticles.settings.child_type = "INTERPOLATED"
             grassParticles.settings.child_length = 0.667
@@ -616,7 +616,7 @@ class testScene4(bpy.types.Operator):
         bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
         cam = bpy.context.active_object.data
         cam.lens = 50
-        cam.draw_size = 0.1
+        cam.display_size = 0.1
 
 # add spot lamp
         bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
@@ -755,7 +755,7 @@ class GenerateHair(bpy.types.Operator):
             hairParticles.settings.use_hair_bspline = True
             hairParticles.settings.render_step = 5
             hairParticles.settings.length_random = 0.5
-            hairParticles.settings.draw_step = 5
+            hairParticles.settings.display_step = 5
 # children
             hairParticles.settings.child_type = "INTERPOLATED"
             hairParticles.settings.create_long_hair_children = True
@@ -860,7 +860,7 @@ class GenerateHair(bpy.types.Operator):
             hairParticles.settings.use_hair_bspline = True
             hairParticles.settings.render_step = 7
             hairParticles.settings.length_random = 0.5
-            hairParticles.settings.draw_step = 5
+            hairParticles.settings.display_step = 5
 # children
             hairParticles.settings.child_type = "INTERPOLATED"
             hairParticles.settings.create_long_hair_children = True
@@ -956,7 +956,7 @@ class GenerateHair(bpy.types.Operator):
             hairParticles.settings.use_hair_bspline = True
             hairParticles.settings.render_step = 3
             hairParticles.settings.length_random = 0.3
-            hairParticles.settings.draw_step = 3
+            hairParticles.settings.display_step = 3
 # children
             hairParticles.settings.child_type = "INTERPOLATED"
             hairParticles.settings.rendered_child_count = 200
@@ -1069,7 +1069,7 @@ class testScene6(bpy.types.Operator):
         bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
         cam = bpy.context.active_object.data
         cam.lens = 50
-        cam.draw_size = 0.1
+        cam.display_size = 0.1
 
 # add spot lamp
         bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
@@ -1207,7 +1207,7 @@ class GenerateFur(bpy.types.Operator):
             furParticles.settings.use_hair_bspline = True
             furParticles.settings.render_step = 5
             furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
+            furParticles.settings.display_step = 5
 # children
             furParticles.settings.child_type = "INTERPOLATED"
             furParticles.settings.child_length = 0.134
@@ -1320,7 +1320,7 @@ class GenerateFur(bpy.types.Operator):
             furParticles.settings.use_hair_bspline = True
             furParticles.settings.render_step = 5
             furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
+            furParticles.settings.display_step = 5
 # children
             furParticles.settings.child_type = "INTERPOLATED"
             furParticles.settings.child_length = 0.07227
@@ -1452,7 +1452,7 @@ class GenerateFur(bpy.types.Operator):
             furParticles.settings.use_hair_bspline = True
             furParticles.settings.render_step = 5
             furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
+            furParticles.settings.display_step = 5
 # children
             furParticles.settings.child_type = "INTERPOLATED"
             furParticles.settings.child_length = 0.134
index 4cdacdb801c7076cf67696dcf443e68ae92a0f5f..22d238b6ace058c0797e56c2ada82844d9e43e5d 100644 (file)
@@ -1432,8 +1432,8 @@ class EnhancedSetCursor(bpy.types.Operator):
                 m = MatrixCompose(_x, y, z, p0)
             snapshot.matrix_world = m
 
-            snapshot.empty_draw_type = 'SINGLE_ARROW'
-            #snapshot.empty_draw_type = 'ARROWS'
+            snapshot.empty_display_type = 'SINGLE_ARROW'
+            #snapshot.empty_display_type = 'ARROWS'
             #snapshot.layers = [True] * 20 # ?
             scene.objects.link(snapshot)
 #============================================================================#
@@ -2502,7 +2502,7 @@ class Snap3DUtility(SnapUtilityBase):
 
         self.bbox_obj = self.cache._make_obj(mesh, None)
         self.bbox_obj.hide = True
-        self.bbox_obj.draw_type = 'WIRE'
+        self.bbox_obj.display_type = 'WIRE'
         self.bbox_obj.name = "BoundBoxSnap"
 
         self.shade_bbox = (shade == 'BOUNDBOX')
@@ -2517,8 +2517,8 @@ class Snap3DUtility(SnapUtilityBase):
         to_exclude = set(to_exclude)
 
         for target in to_include:
-            if only_solid and ((target.draw_type == 'BOUNDS') \
-                    or (target.draw_type == 'WIRE')):
+            if only_solid and ((target.display_type == 'BOUNDS') \
+                    or (target.display_type == 'WIRE')):
                 to_exclude.add(target)
 
         SnapUtilityBase.update_targets(self, to_include, to_exclude)
@@ -2569,7 +2569,7 @@ class Snap3DUtility(SnapUtilityBase):
                        else 'PREVIEW')
             mesh_obj = self.cache.get(obj, variant, reuse=False)
             if (mesh_obj is None) or self.shade_bbox or \
-                    (obj.draw_type == 'BOUNDS'):
+                    (obj.display_type == 'BOUNDS'):
                 if is_local:
                     bbox = [(-1, -1, -1), (1, 1, 1)]
                 else:
@@ -2623,13 +2623,13 @@ class Snap3DUtility(SnapUtilityBase):
                 # is there a better check?
                 # ("a is b" doesn't work here)
                 continue
-            if obj.show_x_ray != x_ray:
+            if obj.show_in_front != x_ray:
                 continue
 
             if is_bbox:
                 obj = self.get_bbox_obj(obj, \
                     sys_matrix, sys_matrix_inv, is_local)
-            elif obj.draw_type == 'BOUNDS':
+            elif obj.display_type == 'BOUNDS':
                 # Outside of BBox, there is no meaningful visual snapping
                 # for such display mode
                 continue
@@ -2780,7 +2780,7 @@ class Snap3DUtility(SnapUtilityBase):
 
         if is_bbox:
             self.bbox_obj.matrix_world = m.copy()
-            self.bbox_obj.show_x_ray = orig_obj.show_x_ray
+            self.bbox_obj.show_in_front = orig_obj.show_in_front
             self.hide_bbox(False)
 
         _ln = ln.copy()
@@ -3182,7 +3182,7 @@ class MeshCache:
 
             # This is necessary for correct bbox display # TODO
             # (though it'd be better to change the logic in the raycasting)
-            tmp_obj.show_x_ray = src_obj.show_x_ray
+            tmp_obj.show_in_front = src_obj.show_in_front
 
             tmp_obj.dupli_faces_scale = src_obj.dupli_faces_scale
             tmp_obj.dupli_frames_end = src_obj.dupli_frames_end
index 7b555a30f4adde4beb4a89fe0eb819d1b29f73d6..bcccd5764ee15ddea6af77178bc1b267271b81fe 100644 (file)
@@ -594,7 +594,7 @@ class VIEW3D_PT_Toolshelf_menu(View3DPanel, Panel):
             layout.menu("VIEW3D_MT_CursorMenuLite2", icon='CURSOR')
             layout.menu("VIEW3D_MT_PoseCopy2", icon='FILE')
 
-            if arm.draw_type in {'BBONE', 'ENVELOPE'}:
+            if arm.display_type in {'BBONE', 'ENVELOPE'}:
                 layout.operator("transform.transform",
                                 text="Scale Envelope Distance").mode = 'BONE_SIZE'
 
@@ -1855,7 +1855,7 @@ class VIEW3D_MT_TransformMenu2(Menu):
         layout = self.layout
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         UseSeparator(self, context)
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -1885,7 +1885,7 @@ class VIEW3D_MT_TransformMenuEdit2(Menu):
         layout = self.layout
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         UseSeparator(self, context)
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -1915,7 +1915,7 @@ class VIEW3D_MT_TransformMenuLite2(Menu):
         layout = self.layout
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         UseSeparator(self, context)
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -1936,7 +1936,7 @@ class VIEW3D_MT_TransformMenuCamera2(Menu):
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         layout.menu("VIEW3D_MT_object_clear")
         layout.menu("VIEW3D_MT_object_apply")
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         layout.operator("object.align")
@@ -1955,7 +1955,7 @@ class VIEW3D_MT_TransformMenuArmature2(Menu):
 
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         UseSeparator(self, context)
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -1981,7 +1981,7 @@ class VIEW3D_MT_TransformMenuArmatureEdit2(Menu):
         layout = self.layout
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
         UseSeparator(self, context)
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -2003,7 +2003,7 @@ class VIEW3D_MT_TransformMenuArmaturePose2(Menu):
     def draw(self, context):
         layout = self.layout
         layout.menu("VIEW3D_MT_ManipulatorMenu12")
-        layout.operator("transform.translate", text="Grab/Move")
+        layout.operator("transform.translate", text="Move")
         layout.operator("transform.rotate", text="Rotate")
         layout.operator("transform.resize", text="Scale")
         UseSeparator(self, context)
@@ -2017,9 +2017,9 @@ class VIEW3D_MT_TransformMenuArmaturePose2(Menu):
         layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
         obj = context.object
         if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
-            if obj.data.draw_type == 'BBONE':
+            if obj.data.display_type == 'BBONE':
                 layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE'
-            elif obj.data.draw_type == 'ENVELOPE':
+            elif obj.data.display_type == 'ENVELOPE':
                 layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE'
                 layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE'
 
@@ -2189,7 +2189,7 @@ class VIEW3D_MT_Shade2(Menu):
 
         UseSeparator(self, context)
         layout.operator("view3d.display_wire_all2", text="Wire all", icon='WIRE')
-        layout.prop(context.object, "show_x_ray", text="X-Ray", icon="META_CUBE")
+        layout.prop(context.object, "show_in_front", text="X-Ray", icon="META_CUBE")
 
         UseSeparator(self, context)
         layout.prop(context.space_data.fx_settings, "use_ssao",