fix: snap user

This commit is contained in:
Swann Martinez
2019-08-14 14:30:51 +02:00
parent d15c099d05
commit b1edd3eab2

View File

@ -243,11 +243,11 @@ class SessionSnapUserOperator(bpy.types.Operator):
def execute(self, context):
area, region, rv3d = presence.view3d_find()
global client
target_client = client.get(
"Client/{}".format(self.target_client))
target_client = client.get(self.target_client)
if target_client:
rv3d.view_location = target_client[0][1]['location'][0]
rv3d.view_location = target_client.buffer['location'][0]
rv3d.view_distance = 30.0
return {"FINISHED"}
@ -257,20 +257,6 @@ class SessionSnapUserOperator(bpy.types.Operator):
pass
class SessionSaveConfig(bpy.types.Operator):
bl_idname = "session.save"
bl_label = "Save session configuration"
bl_description = "Save session configuration"
bl_options = {"REGISTER"}
@classmethod
def poll(cls, context):
return True
def execute(self, context):
context.window_manager.session.save()
class SessionApply(bpy.types.Operator):
bl_idname = "session.apply"
bl_label = "apply the target item into the blender data"
@ -297,7 +283,6 @@ classes = (
SessionPropertyRemoveOperator,
SessionSnapUserOperator,
SessionPropertyRightOperator,
SessionSaveConfig,
SessionApply,
)