global is python keyword so cant use as operator argument,
also ran operator cheat sheet and made sure no syntax errors. + minor pep8 edits.
This commit is contained in:
@@ -22,6 +22,7 @@ import bpy
|
|||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from mathutils import Vector
|
from mathutils import Vector
|
||||||
|
|
||||||
|
|
||||||
def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
|
def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
|
||||||
|
|
||||||
import random
|
import random
|
||||||
@@ -44,9 +45,9 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
|
|||||||
|
|
||||||
if rot:
|
if rot:
|
||||||
vec = rand_vec(rot)
|
vec = rand_vec(rot)
|
||||||
|
|
||||||
rotation_mode = obj.rotation_mode
|
rotation_mode = obj.rotation_mode
|
||||||
if rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
|
if rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||||
obj.rotation_mode = 'XYZ'
|
obj.rotation_mode = 'XYZ'
|
||||||
|
|
||||||
if delta:
|
if delta:
|
||||||
|
@@ -457,8 +457,8 @@ class WM_OT_context_cycle_enum(Operator):
|
|||||||
|
|
||||||
|
|
||||||
class WM_OT_context_cycle_array(Operator):
|
class WM_OT_context_cycle_array(Operator):
|
||||||
'''Set a context array value.
|
'''Set a context array value. '''
|
||||||
Useful for cycling the active mesh edit mode'''
|
'''Useful for cycling the active mesh edit mode'''
|
||||||
bl_idname = "wm.context_cycle_array"
|
bl_idname = "wm.context_cycle_array"
|
||||||
bl_label = "Context Array Cycle"
|
bl_label = "Context Array Cycle"
|
||||||
bl_options = {'UNDO', 'INTERNAL'}
|
bl_options = {'UNDO', 'INTERNAL'}
|
||||||
|
@@ -893,7 +893,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
Main *bmain= CTX_data_main(C);
|
Main *bmain= CTX_data_main(C);
|
||||||
Scene *scene= CTX_data_scene(C);
|
Scene *scene= CTX_data_scene(C);
|
||||||
const short use_global= RNA_boolean_get(op->ptr, "global");
|
const short use_global= RNA_boolean_get(op->ptr, "use_global");
|
||||||
/* int islamp= 0; */ /* UNUSED */
|
/* int islamp= 0; */ /* UNUSED */
|
||||||
|
|
||||||
if(CTX_data_edit_object(C))
|
if(CTX_data_edit_object(C))
|
||||||
@@ -951,7 +951,7 @@ void OBJECT_OT_delete(wmOperatorType *ot)
|
|||||||
/* flags */
|
/* flags */
|
||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
RNA_def_boolean(ot->srna, "global", 0, "Delete Globally", "Remove object from all scenes");
|
RNA_def_boolean(ot->srna, "use_global", 0, "Delete Globally", "Remove object from all scenes");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************** Copy Utilities ******************************/
|
/**************************** Copy Utilities ******************************/
|
||||||
|
Reference in New Issue
Block a user