Skip to content

Commit

Permalink
allow projector creation only in object mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocupe committed Sep 10, 2023
1 parent 947f717 commit 55ec2f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,15 @@ def init_projector(proj_settings, context):


class PROJECTOR_OT_create_projector(Operator):
""" Create Projector """
"""Create Projector"""
bl_idname = 'projector.create'
bl_label = 'Create a new Projector'
bl_options = {'REGISTER', 'UNDO'}

@classmethod
def poll(cls, context):
return context.mode == 'OBJECT'

def execute(self, context):
projector = create_projector(context)
init_projector(projector.proj_settings, context)
Expand Down Expand Up @@ -560,6 +564,7 @@ def update_projected_texture(proj_settings, context):


class PROJECTOR_OT_delete_projector(Operator):
"""Delete Projector"""
bl_idname = 'projector.delete'
bl_label = 'Delete Projector'
bl_options = {'REGISTER', 'UNDO'}
Expand Down

0 comments on commit 55ec2f9

Please sign in to comment.