fix poll errors

2.0.10

- fix: poll error in console
This commit is contained in:
Pullusb
2022-10-16 20:13:52 +02:00
parent e0a50ea49a
commit caa3187772
3 changed files with 9 additions and 3 deletions
+4 -2
View File
@@ -31,7 +31,8 @@ class GPTB_OT_flipx_view(bpy.types.Operator):
@classmethod
def poll(cls, context):
return context.region_data.view_perspective == 'CAMERA'
return context.area.type == 'VIEW_3D' and \
context.region_data.view_perspective == 'CAMERA'
def execute(self, context):
context.scene.camera.scale.x *= -1
@@ -251,7 +252,8 @@ class GPTB_OT_set_view_as_cam(bpy.types.Operator):
@classmethod
def poll(cls, context):
return context.region_data.view_perspective != 'CAMERA'# need to be out of camera
return context.area.type == 'VIEW_3D' and \
context.region_data.view_perspective != 'CAMERA'# need to be out of camera
# return context.scene.camera and not context.scene.camera.name.startswith('Cam')
def execute(self, context):