本文整理汇总了C++中RNA_def_float函数的典型用法代码示例。如果您正苦于以下问题:C++ RNA_def_float函数的具体用法?C++ RNA_def_float怎么用?C++ RNA_def_float使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RNA_def_float函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CLIP_OT_view_zoom_ratio
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
{
/* identifiers */
ot->name = "View Zoom Ratio";
ot->idname = "CLIP_OT_view_zoom_ratio";
ot->description = "Set the zoom ratio (based on clip size)";
/* api callbacks */
ot->exec = view_zoom_ratio_exec;
ot->poll = ED_space_clip_view_clip_poll;
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, -FLT_MAX, FLT_MAX,
"Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
示例2: BRUSH_OT_scale_size
static void BRUSH_OT_scale_size(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Scale Sculpt/Paint Brush Size";
ot->description = "Change brush size by a scalar";
ot->idname = "BRUSH_OT_scale_size";
/* api callbacks */
ot->exec = brush_scale_size_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "scalar", 1, 0, 2, "Scalar", "Factor to scale brush size by", 0, 2);
}
示例3: OBJECT_OT_bake
void OBJECT_OT_bake(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Bake";
ot->description = "Bake image textures of selected objects";
ot->idname = "OBJECT_OT_bake";
/* api callbacks */
ot->exec = bake_exec;
ot->modal = bake_modal;
ot->invoke = bake_invoke;
ot->poll = ED_operator_object_active_editable_mesh;
RNA_def_enum(ot->srna, "type", rna_enum_render_pass_type_items, SCE_PASS_COMBINED, "Type",
"Type of pass to bake, some of them may not be supported by the current render engine");
RNA_def_string_file_path(ot->srna, "filepath", NULL, FILE_MAX, "File Path",
"Image filepath to use when saving externally");
RNA_def_int(ot->srna, "width", 512, 1, INT_MAX, "Width",
"Horizontal dimension of the baking map (external only)", 64, 4096);
RNA_def_int(ot->srna, "height", 512, 1, INT_MAX, "Height",
"Vertical dimension of the baking map (external only)", 64, 4096);
RNA_def_int(ot->srna, "margin", 16, 0, INT_MAX, "Margin",
"Extends the baked result as a post process filter", 0, 64);
RNA_def_boolean(ot->srna, "use_selected_to_active", false, "Selected to Active",
"Bake shading on the surface of selected objects to the active object");
RNA_def_float(ot->srna, "cage_extrusion", 0.0f, 0.0f, FLT_MAX, "Cage Extrusion",
"Distance to use for the inward ray cast when using selected to active", 0.0f, 1.0f);
RNA_def_string(ot->srna, "cage_object", NULL, MAX_NAME, "Cage Object",
"Object to use as cage, instead of calculating the cage from the active object with cage extrusion");
RNA_def_enum(ot->srna, "normal_space", rna_enum_normal_space_items, R_BAKE_SPACE_TANGENT, "Normal Space",
"Choose normal space for baking");
RNA_def_enum(ot->srna, "normal_r", rna_enum_normal_swizzle_items, R_BAKE_POSX, "R", "Axis to bake in red channel");
RNA_def_enum(ot->srna, "normal_g", rna_enum_normal_swizzle_items, R_BAKE_POSY, "G", "Axis to bake in green channel");
RNA_def_enum(ot->srna, "normal_b", rna_enum_normal_swizzle_items, R_BAKE_POSZ, "B", "Axis to bake in blue channel");
RNA_def_enum(ot->srna, "save_mode", rna_enum_bake_save_mode_items, R_BAKE_SAVE_INTERNAL, "Save Mode",
"Choose how to save the baking map");
RNA_def_boolean(ot->srna, "use_clear", false, "Clear",
"Clear Images before baking (only for internal saving)");
RNA_def_boolean(ot->srna, "use_cage", false, "Cage",
"Cast rays to active object from a cage");
RNA_def_boolean(ot->srna, "use_split_materials", false, "Split Materials",
"Split baked maps per material, using material name in output file (external only)");
RNA_def_boolean(ot->srna, "use_automatic_name", false, "Automatic Name",
"Automatically name the output file with the pass type");
RNA_def_string(ot->srna, "uv_layer", NULL, MAX_CUSTOMDATA_LAYER_NAME, "UV Layer", "UV layer to override active");
}
示例4: OBJECT_OT_vertex_group_clean
void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clean Vertex Group";
ot->idname= "OBJECT_OT_vertex_group_clean";
/* api callbacks */
ot->poll= vertex_group_poll;
ot->exec= vertex_group_clean_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f);
RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups.");
RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning.");
}
示例5: CLIP_OT_set_scale
void CLIP_OT_set_scale(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Set Scale";
ot->description = "Set scale of scene by scaling camera (or its parent if present)";
ot->idname = "CLIP_OT_set_scale";
/* api callbacks */
ot->exec = set_scale_exec;
ot->invoke = set_scale_invoke;
ot->poll = set_orientation_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
"Distance", "Distance between selected tracks", -100.0f, 100.0f);
}
示例6: ARMATURE_OT_select_similar
void ARMATURE_OT_select_similar(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Similar";
ot->idname = "ARMATURE_OT_select_similar";
/* callback functions */
ot->invoke = WM_menu_invoke;
ot->exec = armature_select_similar_exec;
ot->poll = ED_operator_editarmature;
ot->description = "Select similar bones by property types";
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", prop_similar_types, 0, "Type", "");
RNA_def_float(ot->srna, "threshold", 0.1f, 0.0f, 1.0f, "Threshold", "", 0.0f, 1.0f);
}
示例7: CURVE_OT_select_similar
void CURVE_OT_select_similar(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Similar";
ot->idname = "CURVE_OT_select_similar";
ot->description = "Select similar curve points by property type";
/* api callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = curve_select_similar_exec;
ot->poll = ED_operator_editsurfcurve;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", curve_prop_similar_types, SIMCURHAND_WEIGHT, "Type", "");
RNA_def_enum(ot->srna, "compare", curve_prop_similar_compare_types, SIM_CMP_EQ, "Compare", "");
RNA_def_float(ot->srna, "threshold", 0.1, 0.0, FLT_MAX, "Threshold", "", 0.0, 100.0);
}
示例8: MBALL_OT_select_similar
void MBALL_OT_select_similar(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Similar";
ot->idname = "MBALL_OT_select_similar";
/* callback functions */
ot->invoke = WM_menu_invoke;
ot->exec = mball_select_similar_exec;
ot->poll = ED_operator_editmball;
ot->description = "Select similar metaballs by property types";
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", prop_similar_types, 0, "Type", "");
RNA_def_float(ot->srna, "threshold", 0.1, 0.0, 1.0, "Threshold", "", 0.01, 1.0);
}
示例9: CLIP_OT_apply_solution_scale
void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Apply Solution Scale";
ot->description = "Apply scale on solution itself to make distance between "
"selected tracks equals to desired";
ot->idname = "CLIP_OT_apply_solution_scale";
/* api callbacks */
ot->exec = apply_solution_scale_exec;
ot->invoke = apply_solution_scale_invoke;
ot->poll = apply_solution_scale_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
"Distance", "Distance between selected tracks",
-100.0f, 100.0f);
}
示例10: CLIP_OT_set_solution_scale
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Set Solution Scale";
ot->description = "Set object solution scale using distance between "
"two selected tracks";
ot->idname = "CLIP_OT_set_solution_scale";
/* api callbacks */
ot->exec = set_solution_scale_exec;
ot->invoke = set_solution_scale_invoke;
ot->poll = set_solution_scale_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
"Distance", "Distance between selected tracks",
-100.0f, 100.0f);
}
示例11: TRANSFORM_OT_rotate
static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name = "Rotate";
ot->description = "Rotate selected items";
ot->idname = OP_ROTATION;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* api callbacks */
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
prop = RNA_def_float(ot->srna, "value", 0.0f, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
RNA_def_property_subtype(prop, PROP_ANGLE);
Transform_Properties(ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT);
}
示例12: 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);
}
示例13: POSE_OT_propagate
void POSE_OT_propagate(wmOperatorType *ot)
{
static EnumPropertyItem terminate_items[] = {
{POSE_PROPAGATE_SMART_HOLDS, "WHILE_HELD", 0, "While Held",
"Propagate pose to all keyframes after current frame that don't change (Default behavior)"},
{POSE_PROPAGATE_NEXT_KEY, "NEXT_KEY", 0, "To Next Keyframe",
"Propagate pose to first keyframe following the current frame only"},
{POSE_PROPAGATE_LAST_KEY, "LAST_KEY", 0, "To Last Keyframe",
"Propagate pose to the last keyframe only (i.e. making action cyclic)"},
{POSE_PROPAGATE_BEFORE_FRAME, "BEFORE_FRAME", 0, "Before Frame",
"Propagate pose to all keyframes between current frame and 'Frame' property"},
{POSE_PROPAGATE_BEFORE_END, "BEFORE_END", 0, "Before Last Keyframe",
"Propagate pose to all keyframes from current frame until no more are found"},
{POSE_PROPAGATE_SELECTED_KEYS, "SELECTED_KEYS", 0, "On Selected Keyframes",
"Propagate pose to all selected keyframes"},
{POSE_PROPAGATE_SELECTED_MARKERS, "SELECTED_MARKERS", 0, "On Selected Markers",
"Propagate pose to all keyframes occurring on frames with Scene Markers after the current frame"},
{0, NULL, 0, NULL, NULL}};
/* identifiers */
ot->name = "Propagate Pose";
ot->idname = "POSE_OT_propagate";
ot->description = "Copy selected aspects of the current pose to subsequent poses already keyframed";
/* callbacks */
ot->exec = pose_propagate_exec;
ot->poll = ED_operator_posemode; /* XXX: needs selected bones! */
/* flag */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
/* TODO: add "fade out" control for tapering off amount of propagation as time goes by? */
ot->prop = RNA_def_enum(ot->srna, "mode", terminate_items, POSE_PROPAGATE_SMART_HOLDS, "Terminate Mode", "Method used to determine when to stop propagating pose to keyframes");
RNA_def_float(ot->srna, "end_frame", 250.0, FLT_MIN, FLT_MAX, "End Frame", "Frame to stop propagating frames to (for 'Before Frame' mode)", 1.0, 250.0);
}
示例14: RNA_api_object
//.........这里部分代码省略.........
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The matrix to transform");
parm = RNA_def_property(func, "matrix_return", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The transformed matrix");
RNA_def_function_output(func, parm);
parm = RNA_def_enum(func,
"from_space",
space_items,
CONSTRAINT_SPACE_WORLD,
"",
"The space in which 'matrix' is currently");
parm = RNA_def_enum(func,
"to_space",
space_items,
CONSTRAINT_SPACE_WORLD,
"",
"The space to which you want to transform 'matrix'");
/* Camera-related operations */
func = RNA_def_function(srna, "calc_matrix_camera", "rna_Object_calc_matrix_camera");
RNA_def_function_ui_description(func,
"Generate the camera projection matrix of this object "
"(mostly useful for Camera and Light types)");
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_property(func, "result", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The camera projection matrix");
RNA_def_function_output(func, parm);
parm = RNA_def_int(func, "x", 1, 0, INT_MAX, "", "Width of the render area", 0, 10000);
parm = RNA_def_int(func, "y", 1, 0, INT_MAX, "", "Height of the render area", 0, 10000);
parm = RNA_def_float(
func, "scale_x", 1.0f, 1.0e-6f, FLT_MAX, "", "Width scaling factor", 1.0e-2f, 100.0f);
parm = RNA_def_float(
func, "scale_y", 1.0f, 1.0e-6f, FLT_MAX, "", "Height scaling factor", 1.0e-2f, 100.0f);
func = RNA_def_function(srna, "camera_fit_coords", "rna_Object_camera_fit_coords");
RNA_def_function_ui_description(func,
"Compute the coordinate (and scale for ortho cameras) "
"given object should be to 'see' all given coordinates");
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_float_array(func,
"coordinates",
1,
NULL,
-FLT_MAX,
FLT_MAX,
"",
"Coordinates to fit in",
-FLT_MAX,
FLT_MAX);
RNA_def_parameter_flags(parm, PROP_NEVER_NULL | PROP_DYNAMIC, PARM_REQUIRED);
parm = RNA_def_property(func, "co_return", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(parm, 3);
RNA_def_property_ui_text(parm, "", "The location to aim to be able to see all given points");
RNA_def_parameter_flags(parm, 0, PARM_OUTPUT);
parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(
parm, "", "The ortho scale to aim to be able to see all given points (if relevant)");
RNA_def_parameter_flags(parm, 0, PARM_OUTPUT);
/* mesh */
示例15: OBJECT_OT_data_transfer
/* transfers weight from active to selected */
void OBJECT_OT_data_transfer(wmOperatorType *ot)
{
PropertyRNA *prop;
/* Identifiers.*/
ot->name = "Transfer Mesh Data";
ot->idname = "OBJECT_OT_data_transfer";
ot->description = "Transfer data layer(s) (weights, edge sharp, ...) from active to selected meshes";
/* API callbacks.*/
ot->poll = data_transfer_poll;
ot->invoke = WM_menu_invoke;
ot->exec = data_transfer_exec;
ot->check = data_transfer_check;
ot->ui = data_transfer_ui;
/* Flags.*/
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* Properties.*/
prop = RNA_def_boolean(ot->srna, "use_reverse_transfer", false, "Reverse Transfer",
"Transfer from selected objects to active one");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
RNA_def_boolean(ot->srna, "use_freeze", false, "Freeze Operator",
"Prevent changes to settings to re-run the operator, "
"handy to change several things at once with heavy geometry");
/* Data type to transfer. */
ot->prop = RNA_def_enum(ot->srna, "data_type", DT_layer_items, 0, "Data Type", "Which data to transfer");
RNA_def_boolean(ot->srna, "use_create", true, "Create Data", "Add data layers on destination meshes if needed");
/* Mapping methods. */
RNA_def_enum(ot->srna, "vert_mapping", rna_enum_dt_method_vertex_items, MREMAP_MODE_VERT_NEAREST, "Vertex Mapping",
"Method used to map source vertices to destination ones");
RNA_def_enum(ot->srna, "edge_mapping", rna_enum_dt_method_edge_items, MREMAP_MODE_EDGE_NEAREST, "Edge Mapping",
"Method used to map source edges to destination ones");
RNA_def_enum(ot->srna, "loop_mapping", rna_enum_dt_method_loop_items, MREMAP_MODE_LOOP_NEAREST_POLYNOR,
"Face Corner Mapping", "Method used to map source faces' corners to destination ones");
RNA_def_enum(ot->srna, "poly_mapping", rna_enum_dt_method_poly_items, MREMAP_MODE_POLY_NEAREST, "Face Mapping",
"Method used to map source faces to destination ones");
/* Mapping options and filtering. */
RNA_def_boolean(ot->srna, "use_auto_transform", false, "Auto Transform",
"Automatically compute transformation to get the best possible match between source and "
"destination meshes (WARNING: results will never be as good as manual matching of objects)");
RNA_def_boolean(ot->srna, "use_object_transform", true, "Object Transform",
"Evaluate source and destination meshes in global space");
RNA_def_boolean(ot->srna, "use_max_distance", false, "Only Neighbor Geometry",
"Source elements must be closer than given distance from destination one");
prop = RNA_def_float(ot->srna, "max_distance", 1.0f, 0.0f, FLT_MAX, "Max Distance",
"Maximum allowed distance between source and destination element, for non-topology mappings",
0.0f, 100.0f);
RNA_def_property_subtype(prop, PROP_DISTANCE);
prop = RNA_def_float(ot->srna, "ray_radius", 0.0f, 0.0f, FLT_MAX, "Ray Radius",
"'Width' of rays (especially useful when raycasting against vertices or edges)",
0.0f, 10.0f);
RNA_def_property_subtype(prop, PROP_DISTANCE);
prop = RNA_def_float(ot->srna, "islands_precision", 0.1f, 0.0f, 10.0f, "Islands Precision",
"Factor controlling precision of islands handling (the higher, the better the results)",
0.0f, 1.0f);
RNA_def_property_subtype(prop, PROP_FACTOR);
/* How to handle multi-layers types of data. */
prop = RNA_def_enum(ot->srna, "layers_select_src", rna_enum_dt_layers_select_src_items, DT_LAYERS_ACTIVE_SRC,
"Source Layers Selection", "Which layers to transfer, in case of multi-layers types");
RNA_def_property_enum_funcs_runtime(prop, NULL, NULL, dt_layers_select_itemf);
prop = RNA_def_enum(ot->srna, "layers_select_dst", rna_enum_dt_layers_select_dst_items, DT_LAYERS_ACTIVE_DST,
"Destination Layers Matching", "How to match source and destination layers");
RNA_def_property_enum_funcs_runtime(prop, NULL, NULL, dt_layers_select_itemf);
prop = RNA_def_enum(ot->srna, "mix_mode", rna_enum_dt_mix_mode_items, CDT_MIX_TRANSFER, "Mix Mode",
"How to affect destination elements with source values");
RNA_def_property_enum_funcs_runtime(prop, NULL, NULL, dt_mix_mode_itemf);
RNA_def_float(ot->srna, "mix_factor", 1.0f, 0.0f, 1.0f, "Mix Factor",
"Factor to use when applying data to destination (exact behavior depends on mix mode)", 0.0f, 1.0f);
}