• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RNA_def_float函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中RNA_def_float函数的典型用法代码示例。如果您正苦于以下问题:C++ RNA_def_float函数的具体用法?C++ RNA_def_float怎么用?C++ RNA_def_float使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了RNA_def_float函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:15,代码来源:clip_ops.c


示例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);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:15,代码来源:paint_ops.c


示例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");
}
开发者ID:Passtechsoft,项目名称:TPEAlpGen,代码行数:46,代码来源:object_bake_api.c


示例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.");
}
开发者ID:jinjoh,项目名称:NOOR,代码行数:17,代码来源:object_vgroup.c


示例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);
}
开发者ID:diekev,项目名称:blender,代码行数:19,代码来源:tracking_ops_orient.c


示例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);
}
开发者ID:JasonWilkins,项目名称:blender-wayland,代码行数:19,代码来源:armature_select.c


示例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);
}
开发者ID:shyamalschandra,项目名称:blender_2.75a,代码行数:20,代码来源:editcurve_select.c


示例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);
}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:20,代码来源:mball_edit.c


示例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);
}
开发者ID:diekev,项目名称:blender,代码行数:21,代码来源:tracking_ops_orient.c


示例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);
}
开发者ID:diekev,项目名称:blender,代码行数:21,代码来源:tracking_ops_orient.c


示例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);
}
开发者ID:AwesomeDoesIt,项目名称:blender-git,代码行数:22,代码来源:transform_ops.c


示例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);
}
开发者ID:ideasman42,项目名称:blender-wayland,代码行数:24,代码来源:editmesh_add.c


示例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);
}
开发者ID:UPBGE,项目名称:blender,代码行数:36,代码来源:pose_slide.c


示例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 */
开发者ID:dfelinto,项目名称:blender,代码行数:67,代码来源:rna_object_api.c


示例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);
}
开发者ID:DarkDefender,项目名称:blender-npr-tess2,代码行数:79,代码来源:object_data_transfer.c


示例16: rna_def_color_ramp

static void rna_def_color_ramp(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	FunctionRNA *func;

	static EnumPropertyItem prop_interpolation_items[] = {
		{COLBAND_INTERP_EASE, "EASE", 0, "Ease", ""},
		{COLBAND_INTERP_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
		{COLBAND_INTERP_LINEAR, "LINEAR", 0, "Linear", ""},
		{COLBAND_INTERP_B_SPLINE, "B_SPLINE", 0, "B-Spline", ""},
		{COLBAND_INTERP_CONSTANT, "CONSTANT", 0, "Constant", ""},
		{0, NULL, 0, NULL, NULL}
	};
	
	static EnumPropertyItem prop_mode_items[] = {
		{COLBAND_BLEND_RGB, "RGB", 0, "RGB", ""},
		{COLBAND_BLEND_HSV, "HSV", 0, "HSV", ""},
		{COLBAND_BLEND_HSL, "HSL", 0, "HSL", ""},
		{0, NULL, 0, NULL, NULL}
	};

	static EnumPropertyItem prop_hsv_items[] = {
		{COLBAND_HUE_NEAR, "NEAR", 0, "Near", ""},
		{COLBAND_HUE_FAR, "FAR", 0, "Far", ""},
		{COLBAND_HUE_CW, "CW", 0, "Clockwise", ""},
		{COLBAND_HUE_CCW, "CCW", 0, "Counter-Clockwise", ""},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "ColorRamp", NULL);
	RNA_def_struct_sdna(srna, "ColorBand");
	RNA_def_struct_path_func(srna, "rna_ColorRamp_path");
	RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color");
	
	prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
	RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
	RNA_def_property_struct_type(prop, "ColorRampElement");
	RNA_def_property_ui_text(prop, "Elements", "");
	RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
	rna_def_color_ramp_element_api(brna, prop);

	prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "ipotype");
	RNA_def_property_enum_items(prop, prop_interpolation_items);
	RNA_def_property_ui_text(prop, "Interpolation", "Set interpolation between color stops");
	RNA_def_property_update(prop, 0, "rna_ColorRamp_update");

	prop = RNA_def_property(srna, "hue_interpolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "ipotype_hue");
	RNA_def_property_enum_items(prop, prop_hsv_items);
	RNA_def_property_ui_text(prop, "Color Interpolation", "Set color interpolation");
	RNA_def_property_update(prop, 0, "rna_ColorRamp_update");

	prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "color_mode");
	RNA_def_property_enum_items(prop, prop_mode_items);
	RNA_def_property_ui_text(prop, "Color Mode", "Set color mode to use for interpolation");
	RNA_def_property_update(prop, 0, "rna_ColorRamp_update");

#if 0 /* use len(elements) */
	prop = RNA_def_property(srna, "total", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "tot");
	/* needs a function to do the right thing when adding elements like colorband_add_cb() */
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_range(prop, 0, 31); /* MAXCOLORBAND = 32 */
	RNA_def_property_ui_text(prop, "Total", "Total number of elements");
	RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
#endif
	
	func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval");
	RNA_def_function_ui_description(func, "Evaluate ColorRamp");
	prop = RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f);
	RNA_def_property_flag(prop, PROP_REQUIRED);
	/* return */
	prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position",
	                           -FLT_MAX, FLT_MAX);
	RNA_def_property_flag(prop, PROP_THICK_WRAP);
	RNA_def_function_output(func, prop);
}
开发者ID:diekev,项目名称:blender,代码行数:80,代码来源:rna_color.c


示例17: RNA_api_ui_layout

void RNA_api_ui_layout(StructRNA *srna)
{
	FunctionRNA *func;
	PropertyRNA *parm;

	static EnumPropertyItem curve_type_items[] = {
		{0, "NONE", 0, "None", ""},
		{'v', "VECTOR", 0, "Vector", ""},
		{'c', "COLOR", 0, "Color", ""},
		{'h', "HUE", 0, "Hue", ""},
		{0, NULL, 0, NULL, NULL}
	};

	static float node_socket_color_default[] = { 0.0f, 0.0f, 0.0f, 1.0f };

	/* simple layout specifiers */
	func = RNA_def_function(srna, "row", "uiLayoutRow");
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_function_ui_description(func,
	                                "Sub-layout. Items placed in this sublayout are placed next to each other "
	                                "in a row");
	RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
	
	func = RNA_def_function(srna, "column", "uiLayoutColumn");
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_function_ui_description(func,
	                                "Sub-layout. Items placed in this sublayout are placed under each other "
	                                "in a column");
	RNA_def_boolean(func, "align", false, "", "Align buttons to each other");

	func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
	RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_boolean(func, "align", false, "", "Align buttons to each other");

	/* box layout */
	func = RNA_def_function(srna, "box", "uiLayoutBox");
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed "
	                                "under each other in a column and are surrounded by a box)");
	
	/* split layout */
	func = RNA_def_function(srna, "split", "uiLayoutSplit");
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f);
	RNA_def_boolean(func, "align", false, "", "Align buttons to each other");

	/* radial/pie layout */
	func = RNA_def_function(srna, "menu_pie", "uiLayoutRadial");
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
	RNA_def_function_return(func, parm);
	RNA_def_function_ui_description(func, "Sublayout. Items placed in this sublayout are placed "
	                                "in a radial fashion around the menu center)");

	/* Icon of a rna pointer */
	func = RNA_def_function(srna, "icon", "rna_ui_get_rnaptr_icon");
	parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
	RNA_def_function_return(func, parm);
	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
	parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take the icon");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
	RNA_def_function_ui_description(func, "Return the custom icon for this data, "
	                                      "use it e.g. to get materials or texture icons");

	/* UI name, description and icon of an enum item */
	func = RNA_def_function(srna, "enum_item_name", "rna_ui_get_enum_name");
	parm = RNA_def_string(func, "name", NULL, 0, "", "UI name of the enum item");
	RNA_def_function_return(func, parm);
	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
	api_ui_item_rna_common(func);
	parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_function_ui_description(func, "Return the UI name for this enum item");

	func = RNA_def_function(srna, "enum_item_description", "rna_ui_get_enum_description");
	parm = RNA_def_string(func, "description", NULL, 0, "", "UI description of the enum item");
	RNA_def_function_return(func, parm);
	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
	api_ui_item_rna_common(func);
	parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_function_ui_description(func, "Return the UI description for this enum item");

	func = RNA_def_function(srna, "enum_item_icon", "rna_ui_get_enum_icon");
	parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
	RNA_def_function_return(func, parm);
	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
	api_ui_item_rna_common(func);
	parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_function_ui_description(func, "Return the icon for this enum item");

	/* items */
	func = RNA_def_function(srna, "prop", "rna_uiItemR");
	RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
//.........这里部分代码省略.........
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:101,代码来源:rna_ui_api.c


示例18: Transform_Properties

void Transform_Properties(struct wmOperatorType *ot, int flags)
{
	PropertyRNA *prop;

	if (flags & P_AXIS) {
		prop = RNA_def_property(ot->srna, "axis", PROP_FLOAT, PROP_DIRECTION);
		RNA_def_property_array(prop, 3);
		/* Make this not hidden when there's a nice axis selection widget */
		RNA_def_property_flag(prop, PROP_HIDDEN);
		RNA_def_property_ui_text(prop, "Axis", "The axis around which the transformation occurs");
	}

	if (flags & P_CONSTRAINT) {
		RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
		prop = RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE);
		RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
		RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
	}

	if (flags & P_MIRROR) {
		prop = RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
		if (flags & P_MIRROR_DUMMY) {
			/* only used so macros can disable this option */
			RNA_def_property_flag(prop, PROP_HIDDEN);
		}
	}


	if (flags & P_PROPORTIONAL) {
		RNA_def_enum(ot->srna, "proportional", rna_enum_proportional_editing_items, 0, "Proportional Editing", "");
		prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", rna_enum_proportional_falloff_items, 0,
		                    "Proportional Editing Falloff", "Falloff type for proportional editing mode");
		RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
		RNA_def_float(ot->srna, "proportional_size", 1, T_PROP_SIZE_MIN, T_PROP_SIZE_MAX,
		              "Proportional Size", "", 0.001f, 100.0f);
	}

	if (flags & P_SNAP) {
		prop = RNA_def_boolean(ot->srna, "snap", 0, "Use Snapping Options", "");
		RNA_def_property_flag(prop, PROP_HIDDEN);

		if (flags & P_GEO_SNAP) {
			prop = RNA_def_enum(ot->srna, "snap_target", rna_enum_snap_target_items, 0, "Target", "");
			RNA_def_property_flag(prop, PROP_HIDDEN);
			prop = RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
			RNA_def_property_flag(prop, PROP_HIDDEN);
			
			if (flags & P_ALIGN_SNAP) {
				prop = RNA_def_boolean(ot->srna, "snap_align", 0, "Align with Point Normal", "");
				RNA_def_property_flag(prop, PROP_HIDDEN);
				prop = RNA_def_float_vector(ot->srna, "snap_normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "", -FLT_MAX, FLT_MAX);
				RNA_def_property_flag(prop, PROP_HIDDEN);
			}
		}
	}
	
	if (flags & P_GPENCIL_EDIT) {
		RNA_def_boolean(ot->srna, "gpencil_strokes", 0, "Edit Grease Pencil", "Edit selected Grease Pencil strokes");
	}
	
	if ((flags & P_OPTIONS) && !(flags & P_NO_TEXSPACE)) {
		RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Texture Space", "Edit Object data texture space");
		prop = RNA_def_boolean(ot->srna, "remove_on_cancel", 0, "Remove on Cancel", "Remove elements on cancel");
		RNA_def_property_flag(prop, PROP_HIDDEN);
	}

	if (flags & P_CORRECT_UV) {
		RNA_def_boolean(ot->srna, "correct_uv", 0, "Correct UVs", "Correct UV coordinates when transforming");
	}

	if ((flags & P_NO_DEFAULTS) == 0) {
		// Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
		/*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
		//RNA_def_property_flag(prop, PROP_HIDDEN);
	}
}
开发者ID:LucaRood,项目名称:Blender,代码行数:76,代码来源:transform_ops.c


示例19: RNA_api_object

<

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RNA_def_float_vector函数代码示例发布时间:2022-05-30
下一篇:
C++ RNA_def_boolean函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap