Skip to content

Commit

Permalink
Projector Settings now have proper units
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocupe committed Jul 30, 2019
1 parent ba14f74 commit 2294754
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ class PROJECTOR_OT_switch_to_cycles(Operator):
def execute(self, context):
context.scene.render.engine = 'CYCLES'
return {'FINISHED'}


def register():
bpy.utils.register_class(PROJECTOR_OT_switch_to_cycles)


def unregister():
bpy.utils.unregister_class(PROJECTOR_OT_switch_to_cycles)
bpy.utils.unregister_class(PROJECTOR_OT_switch_to_cycles)
12 changes: 6 additions & 6 deletions projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def update_lens_shift(projector):
"""
Apply the shift to the camera and texture.
"""
h_shift = projector.proj_settings.get('h_shift')
v_shift = projector.proj_settings.get('v_shift')
h_shift = projector.proj_settings.get('h_shift') / 100
v_shift = projector.proj_settings.get('v_shift') / 100
throw_ratio = projector.proj_settings.get('throw_ratio')

# Update the properties of the camera.
Expand Down Expand Up @@ -349,17 +349,17 @@ def execute(self, context):

class ProjectorSettings(bpy.types.PropertyGroup):
throw_ratio: bpy.props.FloatProperty(
name="Throw Ratio", min=0.01, max=10, update=update_projector)
name="Throw Ratio", soft_min=0.4, soft_max=3, update=update_projector, subtype='FACTOR')
power: bpy.props.FloatProperty(
name="Projector Power", min=0, max=999999, update=update_projector)
name="Projector Power", soft_min=0, soft_max=999999, update=update_projector, unit='POWER')
use_img_texture: bpy.props.BoolProperty(
name="Use Img Texture", update=update_projector)
resolution: bpy.props.EnumProperty(
items=resolutions, default='1920x1080', description="Select a Resolution for your projector", update=update_projector)
h_shift: bpy.props.FloatProperty(
name="Horizontal Shift", min=-5, max=5, update=update_projector)
name="Horizontal Shift", soft_min=-20, soft_max=20, update=update_projector, subtype='PERCENTAGE')
v_shift: bpy.props.FloatProperty(
name="Vertical Shift", min=-5, max=5, update=update_projector)
name="Vertical Shift", soft_min=-20, soft_max=20, update=update_projector, subtype='PERCENTAGE')
projected_color: bpy.props.FloatVectorProperty(
subtype='COLOR', update=on_color_change)

Expand Down

0 comments on commit 2294754

Please sign in to comment.