Skip to content

Commit

Permalink
Merge pull request #31 from Ocupe/allow-projector-creation-only-in-ob…
Browse files Browse the repository at this point in the history
…ject-mode

allow projector creation only in object mode
  • Loading branch information
Ocupe authored Sep 10, 2023
2 parents 947f717 + 55ec2f9 commit 0acccf6
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 0acccf6

Please sign in to comment.