forked from bartvdbraak/blender
[#21295] Escape key doesn't cancel python modal operators
also fix distance with lamps being negative for typed in values.
This commit is contained in:
parent
03590eb8a9
commit
a9307a4dd3
@ -364,7 +364,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
|||||||
self._values_clear()
|
self._values_clear()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
elif event_type in ('RIGHTMOUSE', 'ESCAPE'):
|
elif event_type in ('RIGHTMOUSE', 'ESC'):
|
||||||
self._values_restore()
|
self._values_restore()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class ModalOperator(bpy.types.Operator):
|
|||||||
elif event.type == 'LEFTMOUSE':
|
elif event.type == 'LEFTMOUSE':
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
elif event.type in ('RIGHTMOUSE', 'ESCAPE'):
|
elif event.type in ('RIGHTMOUSE', 'ESC'):
|
||||||
context.object.location.x = self.properties.first_value
|
context.object.location.x = self.properties.first_value
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
@ -346,6 +346,7 @@ static void rna_def_lamp(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
|
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "dist");
|
RNA_def_property_float_sdna(prop, NULL, "dist");
|
||||||
|
RNA_def_property_range(prop, 0, INT_MAX);
|
||||||
RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
|
RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
|
||||||
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point");
|
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point");
|
||||||
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
||||||
|
Loading…
Reference in New Issue
Block a user