pedantic word ordering change.
- wm.add_modal_handler -> modal_handler_add - wm.add_fileselect -> fileselect_add - ob.add_shape_key -> shape_key_add - VIEW3D_OT_add_background_image -> VIEW3D_OT_background_image_add (same for remove) Also made 2 internal cmake vars hidden.
This commit is contained in:
@@ -52,8 +52,8 @@ project(Blender)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Redirect output files
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE )
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
|
||||
@@ -44,7 +44,7 @@ def add_object_align_init(context, operator):
|
||||
return location * rotation
|
||||
|
||||
|
||||
def add_object_data(context, obdata, operator=None):
|
||||
def object_data_add(context, obdata, operator=None):
|
||||
|
||||
scene = context.scene
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class ExportHelper:
|
||||
|
||||
self.filepath = blend_filepath + self.filename_ext
|
||||
|
||||
context.window_manager.add_fileselect(self)
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
def check(self, context):
|
||||
@@ -53,7 +53,7 @@ class ImportHelper:
|
||||
filepath = StringProperty(name="File Path", description="Filepath used for importing the file", maxlen=1024, default="", subtype='FILE_PATH')
|
||||
|
||||
def invoke(self, context, event):
|
||||
context.window_manager.add_fileselect(self)
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class AddTorus(bpy.types.Operator):
|
||||
mesh.update()
|
||||
|
||||
import add_object_utils
|
||||
add_object_utils.add_object_data(context, mesh, operator=self)
|
||||
add_object_utils.object_data_add(context, mesh, operator=self)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def load(operator, context, filepath, frame_start=0, frame_step=1):
|
||||
try:
|
||||
num_keys = len(obj.data.shape_keys.keys)
|
||||
except:
|
||||
basis = obj.add_shape_key()
|
||||
basis = obj.shape_key_add()
|
||||
basis.name = "Basis"
|
||||
obj.data.update()
|
||||
|
||||
@@ -64,7 +64,7 @@ def load(operator, context, filepath, frame_start=0, frame_step=1):
|
||||
def UpdateMesh(ob, fr):
|
||||
|
||||
# Insert new shape key
|
||||
new_shapekey = obj.add_shape_key()
|
||||
new_shapekey = obj.shape_key_add()
|
||||
new_shapekey.name = ("frame_%.4d" % fr)
|
||||
new_shapekey_name = new_shapekey.name
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ class ShapeTransfer(bpy.types.Operator):
|
||||
|
||||
def ob_add_shape(ob, name):
|
||||
me = ob.data
|
||||
key = ob.add_shape_key(from_mix=False)
|
||||
key = ob.shape_key_add(from_mix=False)
|
||||
if len(me.shape_keys.keys) == 1:
|
||||
key.name = "Basis"
|
||||
key = ob.add_shape_key(from_mix=False) # we need a rest
|
||||
key = ob.shape_key_add(from_mix=False) # we need a rest
|
||||
key.name = name
|
||||
ob.active_shape_key_index = len(me.shape_keys.keys) - 1
|
||||
ob.show_only_shape_key = True
|
||||
|
||||
@@ -365,7 +365,7 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
self.size = self._image_size(context)
|
||||
self.filepath = os.path.splitext(bpy.data.filepath)[0]
|
||||
wm = context.window_manager
|
||||
wm.add_fileselect(self)
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
else:
|
||||
self.initial_x = event.mouse_x
|
||||
|
||||
context.window_manager.add_modal_handler(self)
|
||||
context.window_manager.modal_handler_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class ModalOperator(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
if context.object:
|
||||
context.window_manager.add_modal_handler(self)
|
||||
context.window_manager.modal_handler_add(self)
|
||||
self.first_mouse_x = event.mouse_x
|
||||
self.first_value = context.object.location.x
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
@@ -52,7 +52,7 @@ class ModalDrawOperator(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
if context.area.type == 'VIEW_3D':
|
||||
context.window_manager.add_modal_handler(self)
|
||||
context.window_manager.modal_handler_add(self)
|
||||
|
||||
# Add the region OpenGL drawing callback
|
||||
# draw in view space with 'POST_VIEW' and 'PRE_VIEW'
|
||||
|
||||
@@ -42,7 +42,7 @@ class ViewOperator(bpy.types.Operator):
|
||||
v3d = context.space_data
|
||||
rv3d = v3d.region_3d
|
||||
|
||||
context.window_manager.add_modal_handler(self)
|
||||
context.window_manager.modal_handler_add(self)
|
||||
|
||||
if rv3d.view_perspective == 'CAMERA':
|
||||
rv3d.view_perspective = 'PERSP'
|
||||
|
||||
@@ -305,7 +305,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.add_fileselect(self)
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -1203,7 +1203,7 @@ class WM_OT_addon_install(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.add_fileselect(self)
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -575,7 +575,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.add_fileselect(self)
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
# This operator is also used by interaction presets saving - AddPresetBase
|
||||
@@ -665,7 +665,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.add_fileselect(self)
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
@@ -2159,7 +2159,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
|
||||
view = context.space_data
|
||||
|
||||
col = layout.column()
|
||||
col.operator("view3d.add_background_image", text="Add Image")
|
||||
col.operator("view3d.background_image_add", text="Add Image")
|
||||
|
||||
for i, bg in enumerate(view.background_images):
|
||||
layout.active = view.show_background_images
|
||||
@@ -2170,7 +2170,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
|
||||
row.prop(bg.image, "name", text="", emboss=False)
|
||||
else:
|
||||
row.label(text="Not Set")
|
||||
row.operator("view3d.remove_background_image", text="", emboss=False, icon='X').index = i
|
||||
row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
|
||||
|
||||
box.prop(bg, "view_axis", text="Axis")
|
||||
|
||||
|
||||
@@ -1357,9 +1357,9 @@ void ui_set_but_val(uiBut *but, double value)
|
||||
break;
|
||||
case PROP_INT:
|
||||
if(RNA_property_array_length(&but->rnapoin, prop))
|
||||
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, value);
|
||||
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, (int)value);
|
||||
else
|
||||
RNA_property_int_set(&but->rnapoin, prop, value);
|
||||
RNA_property_int_set(&but->rnapoin, prop, (int)value);
|
||||
break;
|
||||
case PROP_FLOAT:
|
||||
if(RNA_property_array_length(&but->rnapoin, prop))
|
||||
|
||||
@@ -480,7 +480,7 @@ static void view3d_dropboxes(void)
|
||||
WM_dropbox_add(lb, "OBJECT_OT_add_named_cursor", view3d_ob_drop_poll, view3d_ob_drop_copy);
|
||||
WM_dropbox_add(lb, "OBJECT_OT_drop_named_material", view3d_mat_drop_poll, view3d_id_drop_copy);
|
||||
WM_dropbox_add(lb, "MESH_OT_drop_named_image", view3d_ima_ob_drop_poll, view3d_id_path_drop_copy);
|
||||
WM_dropbox_add(lb, "VIEW3D_OT_add_background_image", view3d_ima_bg_drop_poll, view3d_id_path_drop_copy);
|
||||
WM_dropbox_add(lb, "VIEW3D_OT_background_image_add", view3d_ima_bg_drop_poll, view3d_id_path_drop_copy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2202,7 +2202,7 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot)
|
||||
|
||||
/* ******************** add background image operator **************** */
|
||||
|
||||
static BGpic *add_background_image(bContext *C)
|
||||
static BGpic *background_image_add(bContext *C)
|
||||
{
|
||||
View3D *v3d= CTX_wm_view3d(C);
|
||||
|
||||
@@ -2218,14 +2218,14 @@ static BGpic *add_background_image(bContext *C)
|
||||
return bgpic;
|
||||
}
|
||||
|
||||
static int add_background_image_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
add_background_image(C);
|
||||
background_image_add(C);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
{
|
||||
View3D *v3d= CTX_wm_view3d(C);
|
||||
Image *ima= NULL;
|
||||
@@ -2244,7 +2244,7 @@ static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNU
|
||||
ima= (Image *)find_id("IM", name);
|
||||
}
|
||||
|
||||
bgpic = add_background_image(C);
|
||||
bgpic = background_image_add(C);
|
||||
|
||||
if (ima) {
|
||||
bgpic->ima = ima;
|
||||
@@ -2261,16 +2261,16 @@ static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNU
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_add_background_image(wmOperatorType *ot)
|
||||
void VIEW3D_OT_background_image_add(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Add Background Image";
|
||||
ot->description= "Add a new background image";
|
||||
ot->idname = "VIEW3D_OT_add_background_image";
|
||||
ot->idname = "VIEW3D_OT_background_image_add";
|
||||
|
||||
/* api callbacks */
|
||||
ot->invoke = add_background_image_invoke;
|
||||
ot->exec = add_background_image_exec;
|
||||
ot->invoke = background_image_add_invoke;
|
||||
ot->exec = background_image_add_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
|
||||
/* flags */
|
||||
@@ -2283,7 +2283,7 @@ void VIEW3D_OT_add_background_image(wmOperatorType *ot)
|
||||
|
||||
|
||||
/* ***** remove image operator ******* */
|
||||
static int remove_background_image_exec(bContext *C, wmOperator *op)
|
||||
static int background_image_remove_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
BGpic *bgpic_rem = CTX_data_pointer_get_type(C, "bgpic", &RNA_BackgroundImage).data;
|
||||
View3D *vd = CTX_wm_view3d(C);
|
||||
@@ -2301,15 +2301,15 @@ static int remove_background_image_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_remove_background_image(wmOperatorType *ot)
|
||||
void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Remove Background Image";
|
||||
ot->description= "Remove a background image from the 3D view";
|
||||
ot->idname = "VIEW3D_OT_remove_background_image";
|
||||
ot->idname = "VIEW3D_OT_background_image_remove";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = remove_background_image_exec;
|
||||
ot->exec = background_image_remove_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
|
||||
/* flags */
|
||||
|
||||
@@ -78,8 +78,8 @@ void VIEW3D_OT_view_center_cursor(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_view_center_camera(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_view_pan(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_view_persportho(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_add_background_image(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_remove_background_image(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_background_image_add(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_background_image_remove(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_view_orbit(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_clip_border(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
|
||||
|
||||
@@ -62,8 +62,8 @@ void view3d_operatortypes(void)
|
||||
WM_operatortype_append(VIEW3D_OT_view_orbit);
|
||||
WM_operatortype_append(VIEW3D_OT_view_pan);
|
||||
WM_operatortype_append(VIEW3D_OT_view_persportho);
|
||||
WM_operatortype_append(VIEW3D_OT_add_background_image);
|
||||
WM_operatortype_append(VIEW3D_OT_remove_background_image);
|
||||
WM_operatortype_append(VIEW3D_OT_background_image_add);
|
||||
WM_operatortype_append(VIEW3D_OT_background_image_remove);
|
||||
WM_operatortype_append(VIEW3D_OT_view_selected);
|
||||
WM_operatortype_append(VIEW3D_OT_view_center_cursor);
|
||||
WM_operatortype_append(VIEW3D_OT_view_center_camera);
|
||||
|
||||
@@ -281,7 +281,7 @@ static void rna_Object_update(Object *ob, Scene *sce, int object, int data, int
|
||||
DAG_id_tag_update(&ob->id, flag);
|
||||
}
|
||||
|
||||
static PointerRNA rna_Object_add_shape_key(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
|
||||
static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
KeyBlock *kb= NULL;
|
||||
@@ -431,7 +431,7 @@ void RNA_api_object(StructRNA *srna)
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
/* Shape key */
|
||||
func= RNA_def_function(srna, "add_shape_key", "rna_Object_add_shape_key");
|
||||
func= RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add");
|
||||
RNA_def_function_ui_description(func, "Add shape key to an object.");
|
||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
|
||||
parm= RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock."); /* optional */
|
||||
|
||||
@@ -63,7 +63,7 @@ static void rna_Operator_enum_search_invoke(bContext *C, wmOperator *op)
|
||||
|
||||
}
|
||||
|
||||
static int rna_event_add_modal_handler(struct bContext *C, struct wmOperator *operator)
|
||||
static int rna_event_modal_handler_add(struct bContext *C, struct wmOperator *operator)
|
||||
{
|
||||
return WM_event_add_modal_handler(C, operator) != NULL;
|
||||
}
|
||||
@@ -104,11 +104,11 @@ void RNA_api_wm(StructRNA *srna)
|
||||
FunctionRNA *func;
|
||||
PropertyRNA *parm;
|
||||
|
||||
func= RNA_def_function(srna, "add_fileselect", "WM_event_add_fileselect");
|
||||
func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
|
||||
RNA_def_function_ui_description(func, "Show up the file selector.");
|
||||
rna_generic_op_invoke(func, 0);
|
||||
|
||||
func= RNA_def_function(srna, "add_modal_handler", "rna_event_add_modal_handler");
|
||||
func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
|
||||
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
|
||||
parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
|
||||
Reference in New Issue
Block a user