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

C++ RNA_def_property_float_sdna函数代码示例

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

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



在下文中一共展示了RNA_def_property_float_sdna函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rna_def_fluidsim_domain

static void rna_def_fluidsim_domain(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static EnumPropertyItem quality_items[] = {
		{OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry."},
		{OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results."},
		{OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results."},
		{0, NULL, 0, NULL, NULL}};

	static EnumPropertyItem viscosity_items[] = {
		{1, "MANUAL", 0, "Manual", "Manual viscosity settings."},
		{2, "WATER", 0, "Water", "Viscosity of 1.0 * 10^-6."},
		{3, "OIL", 0, "Oil", "Viscosity of 5.0 * 10^-5."},
		{4, "HONEY", 0, "Honey", "Viscosity of 2.0 * 10^-3."},
		{0, NULL, 0, NULL, NULL}};

	srna= RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
	RNA_def_struct_sdna(srna, "FluidsimSettings");
	RNA_def_struct_ui_text(srna, "Domain Fluid Simulation Settings", "Fluid simulation settings for the domain of a fluid simulation.");

	/* standard settings */

	prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "resolutionxyz");
	RNA_def_property_range(prop, 1, 1024);
	RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction.");

	prop= RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "previewresxyz");
	RNA_def_property_range(prop, 1, 100);
	RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction.");

	prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
	RNA_def_property_float_sdna(prop, NULL, "animStart");
	RNA_def_property_range(prop, 0, 100);
	RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame.");

	prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
	RNA_def_property_float_sdna(prop, NULL, "animEnd");
	RNA_def_property_range(prop, 0, 100);
	RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame.");

	prop= RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode");
	RNA_def_property_enum_items(prop, quality_items);
	RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport.");
	RNA_def_property_update(prop, 0, "rna_fluid_update");

	prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode");
	RNA_def_property_enum_items(prop, quality_items);
	RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering.");

	prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
	RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames.");

	prop= RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
	RNA_def_property_string_maxlength(prop, 240);
	RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
	RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in.");
	RNA_def_property_update(prop, 0, "rna_fluid_update");

	prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL);
	RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain.");

	/* advanced settings */

	prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
	RNA_def_property_float_sdna(prop, NULL, "gravx");
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, -1000.1, 1000.1);
	RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction.");

	prop= RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "viscosityMode");
	RNA_def_property_enum_items(prop, viscosity_items);
	RNA_def_property_ui_text(prop, "Viscosity Preset", "Set viscosity of the fluid to a preset value, or use manual input.");

	prop= RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "viscosityValue");
	RNA_def_property_range(prop, 0, 10);
	RNA_def_property_ui_text(prop, "Viscosity Base", "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1).");

	prop= RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "viscosityExponent");
	RNA_def_property_range(prop, 0, 10);
	RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6.).");

	prop= RNA_def_property(srna, "real_world_size", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "realsize");
	RNA_def_property_range(prop, 0.001, 10);
	RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres.");

	prop= RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "maxRefine");
//.........这里部分代码省略.........
开发者ID:jinjoh,项目名称:NOOR,代码行数:101,代码来源:rna_fluidsim.c


示例2: rna_def_curvemapping

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

	srna = RNA_def_struct(brna, "CurveMapping", NULL);
	RNA_def_struct_ui_text(srna, "CurveMapping",
	                       "Curve mapping to map color, vector and scalar values to other values using "
	                       "a user defined curve");
	
	prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
	RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary");
	RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set");

	prop = RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "clipr.xmin");
	RNA_def_property_range(prop, -100.0f, 100.0f);
	RNA_def_property_ui_text(prop, "Clip Min X", "");
	RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminx_range");

	prop = RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "clipr.ymin");
	RNA_def_property_range(prop, -100.0f, 100.0f);
	RNA_def_property_ui_text(prop, "Clip Min Y", "");
	RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminy_range");

	prop = RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "clipr.xmax");
	RNA_def_property_range(prop, -100.0f, 100.0f);
	RNA_def_property_ui_text(prop, "Clip Max X", "");
	RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxx_range");

	prop = RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "clipr.ymax");
	RNA_def_property_range(prop, -100.0f, 100.0f);
	RNA_def_property_ui_text(prop, "Clip Max Y", "");
	RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");

	prop = RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next",
	                                  "rna_iterator_array_end", "rna_iterator_array_get",
	                                  "rna_CurveMapping_curves_length", NULL, NULL, NULL);
	RNA_def_property_struct_type(prop, "CurveMap");
	RNA_def_property_ui_text(prop, "Curves", "");

	prop = RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
	RNA_def_property_float_sdna(prop, NULL, "black");
	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
	RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 1, 3);
	RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
	RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);

	prop = RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
	RNA_def_property_float_sdna(prop, NULL, "white");
	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
	RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 1, 3);
	RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
	RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);

	func = RNA_def_function(srna, "update", "curvemapping_changed_all");
	RNA_def_function_ui_description(func, "Update curve mapping after making changes");

	func = RNA_def_function(srna, "initialize", "rna_CurveMap_initialize");
	RNA_def_function_ui_description(func, "Initialize curve");
}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:67,代码来源:rna_color.c


示例3: rna_def_cloth_sim_settings

static void rna_def_cloth_sim_settings(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	
	srna = RNA_def_struct(brna, "ClothSettings", NULL);
	RNA_def_struct_ui_text(srna, "Cloth Settings", "Cloth simulation settings for an object");
	RNA_def_struct_sdna(srna, "ClothSimSettings");
	RNA_def_struct_path_func(srna, "rna_ClothSettings_path");
	
	/* goal */
	
	prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "mingoal");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Goal Minimum",
	                         "Goal minimum, vertex group weights are scaled to match this range");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "maxgoal");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Goal Maximum",
	                         "Goal maximum, vertex group weights are scaled to match this range");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "defgoal");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Goal Default",
	                         "Default Goal (vertex target position) value, when no Vertex Group used");
	RNA_def_property_update(prop, 0, "rna_cloth_update");
	
	prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "goalspring");
	RNA_def_property_range(prop, 0.0f, 0.999f);
	RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness");
	RNA_def_property_update(prop, 0, "rna_cloth_update");
	
	prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "goalfrict");
	RNA_def_property_range(prop, 0.0f, 50.0f);
	RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "velocity_smooth");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Internal Friction", "");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "collider_friction");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Collider Friction", "");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "density_target", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "density_target");
	RNA_def_property_range(prop, 0.0f, 10000.0f);
	RNA_def_property_ui_text(prop, "Target Density", "Maximum density of hair");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "density_strength", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "density_strength");
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Target Density Strength", "Influence of target density on the simulation");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	/* mass */

	prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
	RNA_def_property_range(prop, 0.0f, 10.0f);
	RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
	RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length",
	                              "rna_ClothSettings_mass_vgroup_set");
	RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices");
	RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
	
	prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, -100.0, 100.0);
	RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL);
	RNA_def_property_ui_text(prop, "Gravity", "Gravity or external force vector");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	/* various */

	prop = RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "Cvi");
	RNA_def_property_range(prop, 0.0f, 10.0f);
	RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down");
	RNA_def_property_update(prop, 0, "rna_cloth_update");

	prop = RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "vel_damping");
	RNA_def_property_range(prop, 0.0f, 1.0f);
//.........这里部分代码省略.........
开发者ID:DrangPo,项目名称:blender,代码行数:101,代码来源:rna_cloth.c


示例4: rna_def_gpencil_layer

static void rna_def_gpencil_layer(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	
	srna = RNA_def_struct(brna, "GPencilLayer", NULL);
	RNA_def_struct_sdna(srna, "bGPDlayer");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
	
	/* Name */
	prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Info", "Layer name");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* Frames */
	prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
	RNA_def_property_struct_type(prop, "GPencilFrame");
	RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
	rna_def_gpencil_frames_api(brna, prop);

	/* Active Frame */
	prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "actframe");
	RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
	RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* Drawing Color */
	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "color[3]");
	RNA_def_property_range(prop, 0.3, 1.0f);
	RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Line Thickness */
	prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "thickness");
	RNA_def_property_range(prop, 1, 10);
	RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Onion-Skinning */
	prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
	RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "gstep");
	RNA_def_property_range(prop, 0, 120);
	RNA_def_property_ui_text(prop, "Max Ghost Range",
	                         "Maximum number of frames on either side of the active frame to show "
	                         "(0 = show the 'first' available sketch on either side)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Flags */
	prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
	RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
	RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
	
	prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
	RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* expose as layers.active */
#if 0
	prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
	RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
#endif

	prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
	RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
	
	/* XXX keep this option? */
	prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
	RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
//.........这里部分代码省略.........
开发者ID:244xiao,项目名称:blender,代码行数:101,代码来源:rna_gpencil.c


示例5: rna_def_particle_edit

static void rna_def_particle_edit(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static const EnumPropertyItem select_mode_items[] = {
		{SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
		{SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
		{SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem puff_mode[] = {
		{0, "ADD", 0, "Add", "Make hairs more puffy"},
		{1, "SUB", 0, "Sub", "Make hairs less puffy"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem length_mode[] = {
		{0, "GROW", 0, "Grow", "Make hairs longer"},
		{1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem edit_type_items[] = {
		{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
		{PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
		{PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
		{0, NULL, 0, NULL, NULL}
	};


	/* edit */

	srna = RNA_def_struct(brna, "ParticleEdit", NULL);
	RNA_def_struct_sdna(srna, "ParticleEditSettings");
	RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
	RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");

	prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "brushtype");
	RNA_def_property_enum_items(prop, rna_enum_particle_edit_hair_brush_items);
	RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
	RNA_def_property_ui_text(prop, "Tool", "");

	prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
	RNA_def_property_enum_items(prop, select_mode_items);
	RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");

	prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
	RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");

	prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
	RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");

	prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
	RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");

	prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
	RNA_def_property_float_sdna(prop, NULL, "emitterdist");
	RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
	RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter");

	prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
	RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame");
	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");

	prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
	RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");

	prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
	RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");

	prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
	RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones");

	prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "totaddkey");
	RNA_def_property_range(prop, 2, SHRT_MAX);
	RNA_def_property_ui_range(prop, 2, 20, 10, 3);
	RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");

	prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "ParticleBrush");
	RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
	RNA_def_property_ui_text(prop, "Brush", "");

	prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
	RNA_def_property_range(prop, 1, 10);
	RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with");
//.........这里部分代码省略.........
开发者ID:Ichthyostega,项目名称:blender,代码行数:101,代码来源:rna_sculpt_paint.c


示例6: rna_def_animdata

static void rna_def_animdata(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	
	srna = RNA_def_struct(brna, "AnimData", NULL);
	RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for datablock");
	RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
	
	/* NLA */
	prop = RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL);
	RNA_def_property_struct_type(prop, "NlaTrack");
	RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)");

	rna_api_animdata_nla_tracks(brna, prop);
	
	/* Active Action */
	prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
	/* this flag as well as the dynamic test must be defined for this to be editable... */
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
	RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll");
	RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
	RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA_ACTCHANGE, "rna_AnimData_update");

	/* Active Action Settings */
	prop = RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
	RNA_def_property_enum_items(prop, nla_mode_extend_items);
	RNA_def_property_ui_text(prop, "Action Extrapolation",
	                         "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL);
	
	prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
	RNA_def_property_enum_items(prop, nla_mode_blend_items);
	RNA_def_property_ui_text(prop, "Action Blending",
	                         "Method used for combining Active Action's result with result of NLA stack");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
	
	prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "act_influence");
	RNA_def_property_float_default(prop, 1.0f);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Action Influence",
	                         "Amount the Active Action contributes to the result of the NLA stack");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
	
	/* Drivers */
	prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
	RNA_def_property_struct_type(prop, "FCurve");
	RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock");
	
	rna_api_animdata_drivers(brna, prop);
	
	/* General Settings */
	prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
	RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
}
开发者ID:244xiao,项目名称:blender,代码行数:63,代码来源:rna_animation.c


示例7: rna_def_boid_settings

static void rna_def_boid_settings(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    srna = RNA_def_struct(brna, "BoidSettings", NULL);
    RNA_def_struct_path_func(srna, "rna_BoidSettings_path");
    RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");

    prop = RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "landing_smoothness");
    RNA_def_property_range(prop, 0.0, 10.0);
    RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "banking");
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "pitch");
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    /* states */
    prop = RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidState");
    RNA_def_property_ui_text(prop, "Boid States", "");

    prop = RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidRule");
    RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL);
    RNA_def_property_ui_text(prop, "Active Boid Rule", "");

    prop = RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
    RNA_def_property_int_funcs(prop, "rna_BoidSettings_active_boid_state_index_get",
                               "rna_BoidSettings_active_boid_state_index_set",
                               "rna_BoidSettings_active_boid_state_index_range");
    RNA_def_property_ui_text(prop, "Active Boid State Index", "");

    /* character properties */
    prop = RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Health", "Initial boid health when born");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    /* physical properties */
    prop = RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_min_speed");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_speed");
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_acc");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_ave");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Air Angular Velocity",
                             "Maximum angular velocity in air (relative to 180 degrees)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

//.........这里部分代码省略.........
开发者ID:caomw,项目名称:blender-ui,代码行数:101,代码来源:rna_boid.c


示例8: rna_def_fluidsim_domain

static void rna_def_fluidsim_domain(BlenderRNA *brna)
{
  StructRNA *srna;
  PropertyRNA *prop;

  static const EnumPropertyItem quality_items[] = {
      {OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry"},
      {OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results"},
      {OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results"},
      {0, NULL, 0, NULL, NULL},
  };

  srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
  RNA_def_struct_sdna(srna, "FluidsimSettings");
  RNA_def_struct_ui_text(srna,
                         "Domain Fluid Simulation Settings",
                         "Fluid simulation settings for the domain of a fluid simulation");

  /* standard settings */

  prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "threads");
  RNA_def_property_range(prop, 0, BLENDER_MAX_THREADS);
  RNA_def_property_ui_text(
      prop, "Simulation Threads", "Override number of threads for the simulation, 0 is automatic");

  prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "resolutionxyz");
  RNA_def_property_range(prop, 1, 1024);
  RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "previewresxyz");
  RNA_def_property_range(prop, 1, 100);
  RNA_def_property_ui_text(
      prop, "Preview Resolution", "Preview resolution in X,Y and Z direction");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
  RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode");
  RNA_def_property_enum_items(prop, quality_items);
  RNA_def_property_ui_text(
      prop, "Viewport Display Mode", "How to display the mesh in the viewport");
  RNA_def_property_update(prop, 0, "rna_fluid_update");

  prop = RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE);
  RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode");
  RNA_def_property_enum_items(prop, quality_items);
  RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering");

  prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
  RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames");
  RNA_def_property_update(prop, 0, "rna_fluid_find_enframe");

  prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
  RNA_def_property_string_maxlength(prop, FILE_MAX);
  RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
  RNA_def_property_ui_text(
      prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in");
  RNA_def_property_update(prop, 0, "rna_fluid_update");

  prop = RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_string_funcs(prop,
                                "rna_DomainFluidSettings_memory_estimate_get",
                                "rna_DomainFluidSettings_memory_estimate_length",
                                NULL);
  RNA_def_property_ui_text(
      prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain");

  /* advanced settings */
  prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
  RNA_def_property_float_sdna(prop, NULL, "grav");
  RNA_def_property_array(prop, 3);
  RNA_def_property_range(prop, -1000.1, 1000.1);
  RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");

  prop = RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME);
  RNA_def_property_ui_text(
      prop,
      "Override Time",
      "Use a custom start and end time (in seconds) instead of the scene's timeline");

  prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
  RNA_def_property_float_sdna(prop, NULL, "animStart");
  RNA_def_property_range(prop, 0, FLT_MAX);
  RNA_def_property_ui_text(
      prop, "Start Time", "Simulation time of the first blender frame (in seconds)");

  prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
  RNA_def_property_float_sdna(prop, NULL, "animEnd");
  RNA_def_property_range(prop, 0, FLT_MAX);
  RNA_def_property_ui_text(
      prop, "End Time", "Simulation time of the last blender frame (in seconds)");

  prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "frameOffset");
//.........这里部分代码省略.........
开发者ID:dfelinto,项目名称:blender,代码行数:101,代码来源:rna_fluidsim.c


示例9: RNA_def_camera

void RNA_def_camera(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	static EnumPropertyItem prop_type_items[] = {
		{CAM_PERSP, "PERSP", 0, "Perspective", ""},
		{CAM_ORTHO, "ORTHO", 0, "Orthographic", ""},
		{0, NULL, 0, NULL, NULL}};
	static EnumPropertyItem prop_draw_type_extra_items[] = {
		{CAM_DTX_CENTER, "CENTER", 0, "Center", ""},
		{CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""},
		{CAM_DTX_THIRDS, "THIRDS", 0, "Thirds", ""},
		{CAM_DTX_GOLDEN, "GOLDEN", 0, "Golden", ""},
		{CAM_DTX_GOLDEN_TRI_A, "GOLDEN_TRIANGLE_A", 0, "Golden Triangle A", ""},
		{CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""},
		{CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""},
		{CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""},
		{0, NULL, 0, NULL, NULL}};
	static EnumPropertyItem prop_lens_unit_items[] = {
		{0, "MILLIMETERS", 0, "Millimeters", ""},
		{CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""},
		{0, NULL, 0, NULL, NULL}};

	srna= RNA_def_struct(brna, "Camera", "ID");
	RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
	RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA);

	/* Enums */
	prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, prop_type_items);
	RNA_def_property_ui_text(prop, "Type", "Camera types");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "dtx");
	RNA_def_property_enum_items(prop, prop_draw_type_extra_items);
	RNA_def_property_flag(prop, PROP_ENUM_FLAG);
	RNA_def_property_ui_text(prop, "Composition Guides",  "Draw overlay");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
	
	/* Number values */

	prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
	RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
	RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
	RNA_def_property_float_sdna(prop, NULL, "clipsta");
	RNA_def_property_range(prop, 0.001f, FLT_MAX);
	RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
	RNA_def_property_float_sdna(prop, NULL, "clipend");
	RNA_def_property_range(prop, 1.0f, FLT_MAX);
	RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "lens");
	RNA_def_property_range(prop, 1.0f, 5000.0f);
	RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
	
	prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
	RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens field of view in degrees");
	RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); /* only for deg/rad conversion */
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
	RNA_def_property_range(prop, 0.01f, 4000.0f);
	RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
	RNA_def_property_float_sdna(prop, NULL, "drawsize");
	RNA_def_property_range(prop, 0.01f, 1000.0f);
	RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
	RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shiftx");
	RNA_def_property_range(prop, -10.0f, 10.0f);
	RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
	RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shifty");
	RNA_def_property_range(prop, -10.0f, 10.0f);
	RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
	RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

	prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
//.........这里部分代码省略.........
开发者ID:BHCLL,项目名称:blendocv,代码行数:101,代码来源:rna_camera.c


示例10: rna_def_gpencil_layer

static void rna_def_gpencil_layer(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	
	srna = RNA_def_struct(brna, "GPencilLayer", NULL);
	RNA_def_struct_sdna(srna, "bGPDlayer");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
	RNA_def_struct_path_func(srna, "rna_GPencilLayer_path");
	
	/* Name */
	prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Info", "Layer name");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* Frames */
	prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
	RNA_def_property_struct_type(prop, "GPencilFrame");
	RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
	rna_def_gpencil_frames_api(brna, prop);

	/* Active Frame */
	prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "actframe");
	RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
	RNA_def_property_editable_func(prop, "rna_GPencilLay 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ RNA_def_property_int_sdna函数代码示例发布时间:2022-05-30
下一篇:
C++ RNA_def_property_float_funcs函数代码示例发布时间: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