Draw cam passepartout and UI changes
This commit is contained in:
+8
-4
@@ -153,10 +153,11 @@ class GPTB_OT_draw_cam(bpy.types.Operator):
|
||||
# get main cam and error if not available
|
||||
if drawcam.name == 'draw_cam':
|
||||
maincam = drawcam.parent
|
||||
maincam.data.show_passepartout = context.scene.gptoolprops.drawcam_passepartout
|
||||
|
||||
else:
|
||||
maincam = None
|
||||
main_name = drawcam.get('maincam_name')# Custom prop with previous avtive cam.
|
||||
main_name = drawcam.get('maincam_name')# Custom prop with previous active cam.
|
||||
if main_name:
|
||||
maincam = context.scene.objects.get(main_name)
|
||||
|
||||
@@ -187,14 +188,17 @@ class GPTB_OT_draw_cam(bpy.types.Operator):
|
||||
if not drawcam:
|
||||
created=True
|
||||
drawcam = bpy.data.objects.new(dcam_name, context.scene.camera.data)
|
||||
# drawcam.show_name = True
|
||||
set_collection(drawcam, 'manip_cams')
|
||||
|
||||
if dcam_name == 'draw_cam':
|
||||
drawcam.parent = maincam
|
||||
if created:#set to main at creation time
|
||||
if created: # set to main at creation time
|
||||
drawcam.matrix_world = maincam.matrix_world
|
||||
drawcam.lock_location = (True,True,True)
|
||||
# drawcam.hide_viewport = True
|
||||
context.scene.gptoolprops.drawcam_passepartout = maincam.data.show_passepartout
|
||||
maincam.data.show_passepartout = False
|
||||
|
||||
|
||||
else:
|
||||
if created:
|
||||
@@ -226,7 +230,7 @@ class GPTB_OT_draw_cam(bpy.types.Operator):
|
||||
drawcam.hide_viewport = False
|
||||
maincam.hide_viewport = True
|
||||
|
||||
if created and drawcam.name == 'obj_cam':#Go in camera view
|
||||
if created and drawcam.name == 'obj_cam': # Go in camera view
|
||||
context.region_data.view_perspective = 'CAMERA'
|
||||
# ## make active
|
||||
# bpy.context.view_layer.objects.active = ob
|
||||
|
||||
Reference in New Issue
Block a user