Skip to content

Commit

Permalink
1.0.1: Fixed issue re memory slots switching
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmrqs committed Sep 12, 2021
1 parent c7ddfa3 commit d322bf5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions addon/reference_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"name": "Reference Cameras",
"description": "Handles cameras associated with reference photos",
"author": "Marcelo M. Marques (fork of Witold Jaworski's project)",
"version": (1, 0, 0),
"version": (1, 0, 1),
"blender": (2, 80, 75),
"location": "View3D > side panel ([N]), [Cameras] tab",
"support": "COMMUNITY",
Expand All @@ -36,7 +36,9 @@

#--- ### Change log

#v2.1.0 (08.01.2021) - by Marcelo M. Marques
#v1.0.1 (09.12.2021) - by Marcelo M. Marques
#Fixed: Saved the current camera state to prevent impact by the depsgraph_update_post's after_update() function
#v1.0.0 (09.01.2021) - by Marcelo M. Marques
#Added: Addon preferences with properties to customize most of the panel's features.
#Added: Group of buttons to set the transformation orientation and select the camera/target.
#Added: Button to blink the active meshe(s) by continuously turning visibility on or off.
Expand Down Expand Up @@ -730,6 +732,8 @@ def execute(self, context):
return {'FINISHED'}

def switch_memory_data(slot=0):
global LastState

scn = bpy.context.scene
camera = scn.camera
target = get_target(camera)
Expand Down Expand Up @@ -759,6 +763,9 @@ def switch_memory_data(slot=0):
target.location = backup_slot.TargetLocation
target.rotation_euler = backup_slot.TargetRotation

# Finally save the current state to prevent impact by the depsgraph_update_post's after_update() function
LastState = (camera.name, camera.data.lens)

class RefCameraPanelbutton_M1(bpy.types.Operator):
bl_idname = "object.ref_camera_panelbutton_m1"
bl_label = "M1"
Expand Down

0 comments on commit d322bf5

Please sign in to comment.