本文整理汇总了C++中RNA_def_int函数的典型用法代码示例。如果您正苦于以下问题:C++ RNA_def_int函数的具体用法?C++ RNA_def_int怎么用?C++ RNA_def_int使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RNA_def_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MARKER_OT_duplicate
static void MARKER_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate Time Marker";
ot->description= "Duplicate selected time marker(s).";
ot->idname= "MARKER_OT_duplicate";
/* api callbacks */
ot->exec= ed_marker_duplicate_exec;
ot->invoke= ed_marker_duplicate_invoke;
ot->modal= ed_marker_move_modal;
ot->poll= ED_operator_areaactive;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna storage */
RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
}
示例2: ANIM_OT_keying_set_active_set
void ANIM_OT_keying_set_active_set (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Active Keying Set";
ot->idname= "ANIM_OT_keying_set_active_set";
/* callbacks */
ot->invoke= keyingset_active_menu_invoke;
ot->exec= keyingset_active_menu_exec;
ot->poll= ED_operator_areaactive;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* keyingset to use
* - here the type is int not enum, since many of the indices here are determined dynamically
*/
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
}
示例3: MARKER_OT_select_all_toggle
static void MARKER_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "(De)select all markers";
ot->description= "(de)select all time markers.";
ot->idname= "MARKER_OT_select_all_toggle";
/* api callbacks */
ot->exec= ed_marker_select_all_exec;
ot->invoke= ed_marker_select_all_invoke;
ot->poll= ED_operator_areaactive;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
RNA_def_boolean(ot->srna, "select_swap", 0, "Select Swap", "");
RNA_def_int(ot->srna, "select_type", 0, INT_MIN, INT_MAX, "Select Type", "", INT_MIN, INT_MAX);
}
示例4: FILE_OT_unpack_item
void FILE_OT_unpack_item(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Unpack Item";
ot->idname = "FILE_OT_unpack_item";
ot->description = "Unpack this file to an external file";
/* api callbacks */
ot->exec = unpack_item_exec;
ot->invoke = unpack_item_invoke;
/* flags */
ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "method", unpack_item_method_items, PF_USE_LOCAL, "Method", "How to unpack");
RNA_def_string(ot->srna, "id_name", NULL, BKE_ST_MAXNAME, "ID name", "Name of ID block to unpack");
RNA_def_int(ot->srna, "id_type", ID_IM, 0, INT_MAX, "ID Type", "Identifier type of ID block", 0, INT_MAX);
}
示例5: VIEW3D_OT_layers
void VIEW3D_OT_layers(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Layers";
ot->description = "Toggle layer(s) visibility";
ot->idname = "VIEW3D_OT_layers";
/* api callbacks */
ot->invoke = view3d_layers_invoke;
ot->exec = view3d_layers_exec;
ot->poll = view3d_layers_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "nr", 1, 0, 20, "Number", "The layer number to set, zero for all layers", 0, 20);
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Add this layer to the current view layers");
RNA_def_boolean(ot->srna, "toggle", 1, "Toggle", "Toggle the layer");
}
示例6: POSELIB_OT_pose_add
void POSELIB_OT_pose_add(wmOperatorType *ot)
{
/* identifiers */
ot->name = "PoseLib Add Pose";
ot->idname = "POSELIB_OT_pose_add";
ot->description = "Add the current Pose to the active Pose Library";
/* api callbacks */
ot->invoke = poselib_add_menu_invoke;
ot->exec = poselib_add_exec;
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "frame", 1, 0, INT_MAX, "Frame", "Frame to store pose on", 0, INT_MAX);
RNA_def_string(ot->srna, "name", "Pose", 64, "Pose Name", "Name of newly added Pose");
}
示例7: WM_OT_collada_import
void WM_OT_collada_import(wmOperatorType *ot)
{
ot->name = "Import COLLADA";
ot->description = "Load a Collada file";
ot->idname = "WM_OT_collada_import";
ot->invoke = WM_operator_filesel;
ot->exec = wm_collada_import_exec;
ot->poll = WM_operator_winactive;
//ot->flag |= OPTYPE_PRESET;
ot->ui = wm_collada_import_draw;
WM_operator_properties_filesel(
ot, FILE_TYPE_FOLDER | FILE_TYPE_COLLADA, FILE_BLENDER, FILE_OPENFILE,
WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
RNA_def_boolean(ot->srna,
"import_units", 0, "Import Units",
"If disabled match import to Blender's current Unit settings, "
"otherwise use the settings from the Imported scene");
RNA_def_boolean(ot->srna,
"fix_orientation", 0, "Fix Leaf Bones",
"Fix Orientation of Leaf Bones (Collada does only support Joints)");
RNA_def_boolean(ot->srna,
"find_chains", 0, "Find Bone Chains",
"Find best matching Bone Chains and ensure bones in chain are connected");
RNA_def_int(ot->srna,
"min_chain_length",
0,
0,
INT_MAX,
"Minimum Chain Length",
"When searching Bone Chains disregard chains of length below this value",
0,
INT_MAX);
}
示例8: NLA_OT_action_pushdown
void NLA_OT_action_pushdown(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Push Down Action";
ot->idname = "NLA_OT_action_pushdown";
ot->description = "Push action down onto the top of the NLA stack as a new strip";
/* callbacks */
ot->exec = nlachannels_pushdown_exec;
ot->poll = nlaop_poll_tweakmode_off;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_int(ot->srna, "channel_index", -1, -1, INT_MAX, "Channel Index",
"Index of NLA action channel to perform pushdown operation on",
0, INT_MAX);
RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
}
示例9: ARMATURE_OT_subdivide
void ARMATURE_OT_subdivide(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name = "Subdivide Multi";
ot->idname = "ARMATURE_OT_subdivide";
ot->description = "Break selected bones into chains of smaller bones";
/* api callbacks */
ot->exec = armature_subdivide_exec;
ot->poll = ED_operator_editarmature;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* Properties */
prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, 1000, "Number of Cuts", "", 1, 10);
/* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
示例10: MESH_OT_primitive_circle_add
void MESH_OT_primitive_circle_add(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Add Circle";
ot->description = "Construct a circle mesh";
ot->idname = "MESH_OT_primitive_circle_add";
/* api callbacks */
ot->invoke = WM_operator_view3d_distance_invoke;
ot->exec = add_primitive_circle_exec;
ot->poll = ED_operator_scene_editable;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
make_prim_radius_prop(ot);
RNA_def_enum(ot->srna, "fill_type", fill_type_items, 0, "Fill Type", "");
ED_object_add_generic_props(ot, true);
}
示例11: TRANSFORM_OT_vertex_random
void TRANSFORM_OT_vertex_random(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Randomize";
ot->description = "Randomize vertices";
ot->idname = "TRANSFORM_OT_vertex_random";
/* api callbacks */
ot->exec = object_rand_verts_exec;
ot->poll = ED_transverts_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float(ot->srna, "offset", 0.1f, -FLT_MAX, FLT_MAX, "Amount", "Distance to offset", -10.0f, 10.0f);
RNA_def_float(ot->srna, "uniform", 0.0f, 0.0f, 1.0f, "Uniform",
"Increase for uniform offset distance", 0.0f, 1.0f);
RNA_def_float(ot->srna, "normal", 0.0f, 0.0f, 1.0f, "normal",
"Align offset direction to normals", 0.0f, 1.0f);
RNA_def_int(ot->srna, "seed", 0, 0, 10000, "Random Seed", "Seed for the random number generator", 0, 50);
}
示例12: rna_def_strip_fcurves
static void rna_def_strip_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "NlaStripFCurves");
srna = RNA_def_struct(brna, "NlaStripFCurves", NULL);
RNA_def_struct_sdna(srna, "NlaStrip");
RNA_def_struct_ui_text(srna, "NLA-Strip F-Curves", "Collection of NLA strip F-Curves");
/* Strip.fcurves.find(...) */
func = RNA_def_function(srna, "find", "rna_NlaStrip_fcurve_find");
RNA_def_function_ui_description(func, "Find an F-Curve. Note that this function performs a linear scan "
"of all F-Curves in the NLA strip.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist");
RNA_def_function_return(func, parm);
}
示例13: ANIM_OT_change_frame
static void ANIM_OT_change_frame(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name = "Change Frame";
ot->idname = "ANIM_OT_change_frame";
ot->description = "Interactively change the current frame number";
/* api callbacks */
ot->exec = change_frame_exec;
ot->invoke = change_frame_invoke;
ot->cancel = change_frame_cancel;
ot->modal = change_frame_modal;
ot->poll = change_frame_poll;
/* flags */
ot->flag = OPTYPE_BLOCKING | OPTYPE_UNDO | OPTYPE_GRAB_CURSOR;
/* rna */
ot->prop = RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
prop = RNA_def_boolean(ot->srna, "snap", false, "Snap", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
示例14: RNA_api_sequence_strip
void RNA_api_sequence_strip(StructRNA *srna)
{
FunctionRNA *func;
PropertyRNA *parm;
func = RNA_def_function(srna, "update", "rna_Sequence_update_rnafunc");
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
RNA_def_function_ui_description(func, "Update the strip dimensions");
parm = RNA_def_boolean(func, "data", false, "Data",
"Update strip data");
func = RNA_def_function(srna, "strip_elem_from_frame", "BKE_sequencer_give_stripelem");
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
parm = RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
"The frame to get the strip element from", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "",
"strip element of the current frame"));
func = RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "other", "Sequence", "Other", "");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
示例15: MESH_OT_primitive_ico_sphere_add
void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name = "Add Ico Sphere";
ot->description = "Construct an Icosphere mesh";
ot->idname = "MESH_OT_primitive_ico_sphere_add";
/* api callbacks */
ot->invoke = WM_operator_view3d_distance_invoke;
ot->exec = add_primitive_icosphere_exec;
ot->poll = ED_operator_scene_editable;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "subdivisions", 2, 1, INT_MAX, "Subdivisions", "", 1, 8);
prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
RNA_def_property_subtype(prop, PROP_DISTANCE);
ED_object_add_generic_props(ot, true);
}