Skip to content

Commit

Permalink
2.8: update for x_ray and draw/display renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtvl committed Sep 6, 2018
1 parent 1132085 commit 9ff1e5e
Show file tree
Hide file tree
Showing 42 changed files with 128 additions and 129 deletions.
2 changes: 1 addition & 1 deletion add_advanced_objects_menu/mesh_easylattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def createLattice(context, obj, props):
# the rotation comes from the combined obj world
# matrix which was converted to euler pairs
ob.rotation_euler = buildRot_World(obj)
ob.show_x_ray = True
ob.show_in_front = True

# Link object to scene
scn = context.scene
Expand Down
2 changes: 1 addition & 1 deletion add_advanced_objects_menu/rope_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def execute(self, context):
bpy.ops.rigidbody.objects_add(type='ACTIVE')
bpy.context.object.name = "CubeLink"
if n != 0:
bpy.context.object.draw_type = 'WIRE'
bpy.context.object.display_type = 'WIRE'
bpy.context.object.hide_render = True
n += 1
bpy.context.object.scale.z = (longitud * 2) / (segmentos * 2) - separation
Expand Down
2 changes: 1 addition & 1 deletion add_advanced_objects_menu/scene_objects_bi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def execute(self, context):
)
cam = bpy.context.active_object.data
cam.lens = 35
cam.draw_size = 0.1
cam.display_size = 0.1
bpy.ops.view3d.viewnumpad(type='CAMERA')

# add point lamp
Expand Down
2 changes: 1 addition & 1 deletion add_advanced_objects_menu/scene_objects_cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def execute(self, context):
)
cam = bpy.context.active_object.data
cam.lens = 35
cam.draw_size = 0.1
cam.display_size = 0.1
bpy.ops.view3d.viewnumpad(type='CAMERA')

# add point lamp
Expand Down
2 changes: 1 addition & 1 deletion add_advanced_objects_menu/scene_texture_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def execute(self, context):
)
cam = bpy.context.active_object.data
cam.lens = 35
cam.draw_size = 0.1
cam.display_size = 0.1

# add plane
bpy.ops.mesh.primitive_plane_add(enter_editmode=True, location=(0, 0, 0))
Expand Down
2 changes: 1 addition & 1 deletion add_advanced_objects_panels/object_laplace_lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ def setupObjects():
bpy.context.scene.objects.link(oOB)

gOB = bpy.data.objects.new('ELground', None)
gOB.empty_draw_type = 'ARROWS'
gOB.empty_display_type = 'ARROWS'
bpy.context.scene.objects.link(gOB)

cME = makeMeshCube(1)
Expand Down
4 changes: 2 additions & 2 deletions add_advanced_objects_panels/unfold_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def execute(self, context):
scn.objects.link(rig)
scn.objects.active = rig
bpy.ops.object.mode_set(mode="EDIT")
arm.draw_type = "WIRE"
rig.show_x_ray = True
arm.display_type = "WIRE"
rig.show_in_front = True
mod = obj.modifiers.new("UnFold", "ARMATURE")
mod.show_in_editmode = True
mod.object = rig
Expand Down
2 changes: 1 addition & 1 deletion add_curve_extra_objects/add_curve_spirofit_bouncespline.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def add_curve_object(
bpy.context.scene.objects.active = cur
cur.select = True
if x_ray is True:
cur.show_x_ray = x_ray
cur.show_in_front = x_ray
return


Expand Down
6 changes: 3 additions & 3 deletions add_curve_sapling/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,13 @@ def create_armature(armAnim, leafP, cu, frameRate, leafMesh, leafObj, leafVertSi
newAction = bpy.data.actions.new(name='windAction')
armOb.animation_data_create()
armOb.animation_data.action = newAction
arm.draw_type = 'STICK'
arm.display_type = 'STICK'
arm.use_deform_delay = True
# Add the armature modifier to the curve
armMod = treeOb.modifiers.new('windSway', 'ARMATURE')
if previewArm:
armMod.show_viewport = False
arm.draw_type = 'WIRE'
arm.display_type = 'WIRE'
treeOb.hide = True
armMod.use_apply_on_spline = True
armMod.object = armOb
Expand Down Expand Up @@ -1996,7 +1996,7 @@ def addTree(props):
armMod = treeObj.modifiers.new('windSway', 'ARMATURE')
if previewArm:
bpy.data.objects['treeArm'].hide = True
bpy.data.armatures['tree'].draw_type = 'STICK'
bpy.data.armatures['tree'].display_type = 'STICK'
armMod.object = bpy.data.objects['treeArm']
armMod.use_bone_envelopes = False
armMod.use_vertex_groups = True
Expand Down
2 changes: 1 addition & 1 deletion add_mesh_extra_objects/add_empty_as_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def execute(self, context):
bpy.ops.object.add(type='EMPTY', location=loc)
context.object.name = self.nombre
context.object.show_name = True
context.object.show_x_ray = True
context.object.show_in_front = True

if self.grupo:
bpy.ops.group.create(name=self.nombre)
Expand Down
4 changes: 2 additions & 2 deletions archimesh/achm_door_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def shape_children(mainobject, update=False):
myctrl.location.x = 0
myctrl.location.y = -((mp.frame_thick * 3) / 2)
myctrl.location.z = -gap
myctrl.draw_type = 'BOUNDS'
myctrl.display_type = 'BOUNDS'
myctrl.hide = False
myctrl.hide_render = True
if bpy.context.scene.render.engine == 'CYCLES':
Expand All @@ -256,7 +256,7 @@ def shape_children(mainobject, update=False):
myctrlbase.location.x = 0
myctrlbase.location.y = -0.15 - (mp.frame_thick / 3)
myctrlbase.location.z = -0.10
myctrlbase.draw_type = 'BOUNDS'
myctrlbase.display_type = 'BOUNDS'
myctrlbase.hide = False
myctrlbase.hide_render = True
if bpy.context.scene.render.engine == 'CYCLES':
Expand Down
2 changes: 1 addition & 1 deletion archimesh/achm_window_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def shape_mesh_and_create_children(mainobject, tmp_mesh, update=False):
myctrl.location.x = 0
myctrl.location.y = -mp.depth * 3 / 2
myctrl.location.z = 0
myctrl.draw_type = 'BOUNDS'
myctrl.display_type = 'BOUNDS'
myctrl.hide = False
myctrl.hide_render = True
if bpy.context.scene.render.engine == 'CYCLES':
Expand Down
2 changes: 1 addition & 1 deletion archimesh/achm_window_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def do_ctrl_box(myobject):
myctrl.location.x = 0
myctrl.location.y = 0
myctrl.location.z = 0
myctrl.draw_type = 'WIRE'
myctrl.display_type = 'WIRE'
myctrl.hide = False
myctrl.hide_render = True
if bpy.context.scene.render.engine == 'CYCLES':
Expand Down
2 changes: 1 addition & 1 deletion archipack/archipack_autoboolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def prepare_hole(self, hole):
hole.lock_location = (True, True, True)
hole.lock_rotation = (True, True, True)
hole.lock_scale = (True, True, True)
hole.draw_type = 'WIRE'
hole.display_type = 'WIRE'
hole.hide_render = True
hole.hide_select = True
hole.select = True
Expand Down
3 changes: 1 addition & 2 deletions archipack/archipack_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,7 @@ def size(self, context):
y_max = h - self.margin
x_min = self.margin
x_max = w - self.margin
if (system.use_region_overlap and
system.window_draw_method in {'TRIPLE_BUFFER', 'AUTOMATIC'}):
if system.use_region_overlap:
area = context.area

for r in area.regions:
Expand Down
2 changes: 1 addition & 1 deletion archipack/archipack_wall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ def modal(self, context, event):
m = o.modifiers.get("AutoBoolean")
if m is not None:
o.hide = False
# o.draw_type = 'TEXTURED'
# o.display_type = 'TEXTURED'
# m.show_viewport = True

return self.cancel(context)
Expand Down
12 changes: 6 additions & 6 deletions camera_dolly_crane_rigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def build_dolly_rig(context):
cam.data.name = "Dolly_Camera.000"

cam_data_name = bpy.context.object.data.name
bpy.data.cameras[cam_data_name].draw_size = 1.0
bpy.data.cameras[cam_data_name].display_size = 1.0
cam.rotation_euler[0] = 1.5708 # rotate the camera 90 degrees in x
cam.location = (0.0, -2.0, 0.0) # move the camera to the correct postion
cam.parent = rig
Expand Down Expand Up @@ -631,9 +631,9 @@ def build_crane_rig(context):
ctrlAimChild.parent = ctrlAim

# change display to BBone: it just looks nicer
bpy.context.object.data.draw_type = 'BBONE'
bpy.context.object.data.display_type = 'BBONE'
# change display to wire for object
bpy.context.object.draw_type = 'WIRE'
bpy.context.object.display_type = 'WIRE'

# jump into pose mode and change bones to euler
bpy.ops.object.mode_set(mode='POSE')
Expand Down Expand Up @@ -718,7 +718,7 @@ def build_crane_rig(context):
cam.data.name = "Crane_Camera.000"

cam_data_name = bpy.context.object.data.name
bpy.data.cameras[cam_data_name].draw_size = 1.0
bpy.data.cameras[cam_data_name].display_size = 1.0
cam.rotation_euler[0] = 1.5708 # rotate the camera 90 degrees in x
cam.location = (0.0, -2.0, 0.0) # move the camera to the correct postion
cam.parent = rig
Expand Down Expand Up @@ -801,7 +801,7 @@ def draw(self, context):
text="Make Active Camera", icon='CAMERA_DATA')

col.prop(context.active_object,
'show_x_ray', toggle=False, text='X Ray')
'show_in_front', toggle=False, text='X Ray')
col.prop(cam, "show_limits")
col.prop(cam, "show_safe_areas")
col.prop(cam, "show_passepartout")
Expand Down Expand Up @@ -865,7 +865,7 @@ def draw(self, context):
col.operator(
"scene.make_camera_active", text="Make Active Camera", icon='CAMERA_DATA')
col.prop(
context.active_object, 'show_x_ray', toggle=False, text='X Ray')
context.active_object, 'show_in_front', toggle=False, text='X Ray')
col.prop(cam, "show_limits")
col.prop(cam, "show_safe_areas")
col.prop(cam, "show_passepartout")
Expand Down
2 changes: 1 addition & 1 deletion camera_turnaround.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def execute(self, context):
context.user_preferences.edit.keyframe_new_interpolation_type = 'LINEAR'
# create first frame
myempty.rotation_euler = (0, 0, 0)
myempty.empty_draw_size = 0.1
myempty.empty_display_size = 0.1
context.scene.frame_set(scene.frame_start)
myempty.keyframe_insert(data_path='rotation_euler', frame=scene.frame_start)

Expand Down
2 changes: 1 addition & 1 deletion io_anim_acclaim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def create_armature(self):
self.armature = self.object.data
self.object.name = self.name
self.armature.name = self.name
self.armature.draw_type = 'STICK'
self.armature.display_type = 'STICK'
self.object['source_file_path'] = self.file_path
self.object['source_scale'] = self.user_def_scale
self.object['MhxArmature'] = 'Daz'
Expand Down
4 changes: 2 additions & 2 deletions io_anim_bvh/import_bvh.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ def add_ob(name):
obj.select = True

# nicer drawing.
obj.empty_draw_type = 'CUBE'
obj.empty_draw_size = 0.1
obj.empty_display_type = 'CUBE'
obj.empty_display_size = 0.1

return obj

Expand Down
4 changes: 2 additions & 2 deletions io_anim_c3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def create_empties(self, ms):
unames[name] = o.name
bpy.ops.transform.resize(value=empty_size)
o.show_name = self.properties.show_names
o.show_x_ray = self.properties.x_ray
o.show_in_front = self.properties.x_ray
for name in unames.values():
bpy.context.scene.objects[name].select = True
return unames
Expand All @@ -291,7 +291,7 @@ def create_armature_obj(self, ms, scale):
arm = bpy.context.active_object
arm.name = os.path.basename(self.properties.filepath)
arm.data.show_names = self.properties.show_names
arm.show_x_ray = self.properties.x_ray
arm.show_in_front = self.properties.x_ray
for idx, ml in enumerate(ms.markerLabels):
name = self.properties.prefix + ml
bpy.ops.armature.select_all(action='DESELECT')
Expand Down
2 changes: 1 addition & 1 deletion io_anim_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def write_cameras(context, filepath, frame_start, frame_end, only_selected=False
'dof_distance',
'clip_start',
'clip_end',
'draw_size',
'display_size',
)

obj_attrs = (
Expand Down
2 changes: 1 addition & 1 deletion io_import_dxf/dxfimport/do.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def block_group_instances(self, entity, scene, name=None, override_group=None, i

bpy.context.screen.scene = scene
o = bbox.copy()
# o.empty_draw_size = 0.3
# o.empty_display_size = 0.3
o.dupli_type = "GROUP"
o.dupli_group = block_group
group.objects.link(o)
Expand Down
6 changes: 3 additions & 3 deletions io_scene_fbx/export_fbx_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2073,13 +2073,13 @@ def restore_object(ob_to, ob_from):
'delta_location', 'delta_rotation_euler', 'delta_rotation_quaternion', 'delta_scale',
'lock_location', 'lock_rotation', 'lock_rotation_w', 'lock_rotations_4d', 'lock_scale',
'tag', 'layers', 'select', 'track_axis', 'up_axis', 'active_material', 'active_material_index',
'matrix_parent_inverse', 'empty_draw_type', 'empty_draw_size', 'empty_image_offset', 'pass_index',
'matrix_parent_inverse', 'empty_display_type', 'empty_display_size', 'empty_image_offset', 'pass_index',
'color', 'hide', 'hide_select', 'hide_render', 'use_slow_parent', 'slow_parent_offset',
'use_extra_recalc_object', 'use_extra_recalc_data', 'dupli_type', 'use_dupli_frames_speed',
'use_dupli_vertices_rotation', 'use_dupli_faces_scale', 'dupli_faces_scale', 'dupli_group',
'dupli_frames_start', 'dupli_frames_end', 'dupli_frames_on', 'dupli_frames_off',
'draw_type', 'show_bounds', 'draw_bounds_type', 'show_name', 'show_axis', 'show_texture_space',
'show_wire', 'show_all_edges', 'show_transparent', 'show_x_ray',
'display_type', 'show_bounds', 'display_bounds_type', 'show_name', 'show_axis', 'show_texture_space',
'show_wire', 'show_all_edges', 'show_transparent', 'show_in_front',
'show_only_shape_key', 'use_shape_key_edit_mode', 'active_shape_key_index',
)
for p in props:
Expand Down
4 changes: 2 additions & 2 deletions io_scene_ms3d/ms3d_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,14 @@ def create_animation(self, blender_context, ms3d_model, blender_mesh_object):
blender_armature = blender_context.blend_data.armatures.new(
ms3d_armature_name)
blender_armature.ms3d.name = ms3d_model.name
blender_armature.draw_type = 'STICK'
blender_armature.display_type = 'STICK'
blender_armature.show_axes = True
blender_armature.use_auto_ik = True
blender_armature_object = blender_context.blend_data.objects.new(
ms3d_armature_object_name, blender_armature)
blender_scene.objects.link(blender_armature_object)
#blender_armature_object.location = blender_scene.cursor_location
blender_armature_object.show_x_ray = True
blender_armature_object.show_in_front = True

##########################
# create new modifier
Expand Down
4 changes: 2 additions & 2 deletions io_scene_x3d/import_x3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3271,8 +3271,8 @@ def importTransform(bpyscene, node, ancestry, global_matrix):
bpyob.matrix_world = getFinalMatrix(node, None, ancestry, global_matrix)

# so they are not too annoying
bpyob.empty_draw_type = 'PLAIN_AXES'
bpyob.empty_draw_size = 0.2
bpyob.empty_display_type = 'PLAIN_AXES'
bpyob.empty_display_size = 0.2


#def importTimeSensor(node):
Expand Down
2 changes: 1 addition & 1 deletion light_field_tools/light_field_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def createCameraMultiple(self):
cam.data.angle = scene.lightfield.angle

# display options of the camera
cam.data.draw_size = 0.15
cam.data.display_size = 0.15
cam.data.lens_unit = 'FOV'

# handler parent
Expand Down
2 changes: 1 addition & 1 deletion measureit/measureit_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ def execute(self, context):
bpy.ops.object.empty_add(type='PLAIN_AXES')
myempty = bpy.data.objects[bpy.context.active_object.name]
myempty.location = bpy.context.scene.cursor_location
myempty.empty_draw_size = 0.01
myempty.empty_display_size = 0.01
myempty.name = "Annotation"
# Add properties
scene = context.scene
Expand Down
Loading

0 comments on commit 9ff1e5e

Please sign in to comment.