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

C++ RNA_def_struct_sdna函数代码示例

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

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



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

示例1: rna_def_smoke_domain_settings

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

	static EnumPropertyItem prop_noise_type_items[] = {
		{MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
#ifdef WITH_FFTW3
		{MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
#endif
		/*  {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
		{0, NULL, 0, NULL, NULL}
	};

	static EnumPropertyItem smoke_cache_comp_items[] = {
		{SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"},
		{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
		{0, NULL, 0, NULL, NULL}
	};

	static EnumPropertyItem smoke_highres_sampling_items[] = {
		{SM_HRES_FULLSAMPLE, "FULLSAMPLE", 0, "Full Sample", ""},
		{SM_HRES_LINEAR, "LINEAR", 0, "Linear", ""},
		{SM_HRES_NEAREST, "NEAREST", 0, "Nearest", ""},
		{0, NULL, 0, NULL, NULL}
	};

	static EnumPropertyItem smoke_domain_colli_items[] = {
		{SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
		{SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
		 "Smoke doesn't collide with top and bottom sides"},
		{SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
	RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
	RNA_def_struct_sdna(srna, "SmokeDomainSettings");
	RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");

	prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "maxres");
	RNA_def_property_range(prop, 24, 512);
	RNA_def_property_ui_range(prop, 24, 512, 2, -1);
	RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");

	prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "amplify");
	RNA_def_property_range(prop, 1, 10);
	RNA_def_property_ui_range(prop, 1, 10, 1, -1);
	RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");

	prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
	RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");

	prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
	RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);

	prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "noise");
	RNA_def_property_enum_items(prop, prop_noise_type_items);
	RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");

	prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "alpha");
	RNA_def_property_range(prop, -5.0, 5.0);
	RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
	RNA_def_property_ui_text(prop, "Density",
	                         "How much density affects smoke motion (higher value results in faster rising smoke)");
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");

	prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "beta");
	RNA_def_property_range(prop, -5.0, 5.0);
	RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
	RNA_def_property_ui_text(prop, "Heat",
	                         "How much heat affects smoke motion (higher value results in faster rising smoke)");
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");

	prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
	RNA_def_property_struct_type(prop, "Group");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group");
	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependancy");

	prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
	RNA_def_property_struct_type(prop, "Group");
//.........这里部分代码省略.........
开发者ID:Eibriel,项目名称:kiriblender,代码行数:101,代码来源:rna_smoke.c


示例2: rna_def_world_mtex

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

	static EnumPropertyItem texco_items[] = {
		{TEXCO_VIEW, "VIEW", 0, "View", "Use view vector for the texture coordinates"},
		{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates (interior mist)"},
		{TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"},
		{TEXCO_H_SPHEREMAP, "SPHERE", 0, "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"},
		{TEXCO_EQUIRECTMAP, "EQUIRECT", 0, "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"},
		{TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"},
		{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot");
	RNA_def_struct_sdna(srna, "MTex");
	RNA_def_struct_ui_text(srna, "World Texture Slot", "Texture slot for textures in a World data-block");

	/* map to */
	prop = RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
	RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
	RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
	RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
	RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "lod_bias", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "lodbias");
	RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 10, 3);
	RNA_def_property_ui_text(prop, "Lod Bias", "Amount bias on mipmapping");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "texco");
	RNA_def_property_enum_items(prop, texco_items);
	RNA_def_property_ui_text(prop, "Texture Coordinates",
	                         "Texture coordinates used to map the texture onto the background");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "object");
	RNA_def_property_struct_type(prop, "Object");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "blendfac");
	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
	RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "colfac");
	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
	RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "zenupfac");
	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
	RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above");
	RNA_def_property_update(prop, 0, "rna_World_update");

	prop = RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "zendownfac");
	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
	RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below");
	RNA_def_property_update(prop, 0, "rna_World_update");
}
开发者ID:UPBGE,项目名称:blender,代码行数:85,代码来源:rna_world.c


示例3: rna_def_sensor

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

	srna = RNA_def_struct(brna, "Sensor", NULL);
	RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events");
	RNA_def_struct_sdna(srna, "bSensor");
	RNA_def_struct_refine_func(srna, "rna_Sensor_refine");

	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Name", "Sensor name");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_enum_items(prop, sensor_type_items);
	RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf");
	RNA_def_property_ui_text(prop, "Type", "");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN);
	RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
	RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SENS_DEACTIVATE);
	RNA_def_property_ui_text(prop, "Active", "Set active state of the sensor");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW);
	RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface");
	RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "level", 1);
	RNA_def_property_ui_text(prop, "Level",
	                         "Level detector, trigger controllers of new states "
	                         "(only applicable upon logic state transition)");
	RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT);
	RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE);
	RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)");
	RNA_def_property_update(prop, NC_LOGIC, NULL);
	
	prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "freq");
	RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)");
	RNA_def_property_range(prop, 0, 10000);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tap", 1);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set");
	RNA_def_property_ui_text(prop, "Tap",
	                         "Trigger controllers only for an instant, even while the sensor remains true");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
	RNA_def_property_struct_type(prop, "Controller");
	RNA_def_property_ui_text(prop, "Controllers", "The list containing the controllers connected to the sensor");
	RNA_def_property_collection_funcs(prop, "rna_Sensor_controllers_begin", "rna_iterator_array_next",
	                                  "rna_iterator_array_end", "rna_iterator_array_dereference_get",
	                                  "rna_Sensor_controllers_length", NULL, NULL, NULL);


	RNA_api_sensor(srna);
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:86,代码来源:rna_sensor.c


示例4: rna_def_keyingset_path

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

    srna = RNA_def_struct(brna, "KeyingSetPath", NULL);
    RNA_def_struct_sdna(srna, "KS_Path");
    RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set");

    /* ID */
    prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
    RNA_def_property_struct_type(prop, "ID");
    RNA_def_property_flag(prop, PROP_EDITABLE);
    RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
    RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL);
    RNA_def_property_ui_text(prop, "ID-Block",
                             "ID-Block that keyframes for Keying Set should be added to "
                             "(for Absolute Keying Sets only)");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_sdna(prop, NULL, "idtype");
    RNA_def_property_enum_items(prop, id_type_items);
    RNA_def_property_enum_default(prop, ID_OB);
    RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL);
    RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    /* Group */
    prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
    RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    /* Grouping */
    prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_sdna(prop, NULL, "groupmode");
    RNA_def_property_enum_items(prop, keyingset_path_grouping_items);
    RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    /* Path + Array Index */
    prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
    RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length",
                                  "rna_ksPath_RnaPath_set");
    RNA_def_property_ui_text(prop, "Data Path", "Path to property setting");
    RNA_def_struct_name_property(srna, prop); /* XXX this is the best indicator for now... */
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL);

    /* called 'index' when given as function arg */
    prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
    RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    /* Flags */
    prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY);
    RNA_def_property_ui_text(prop, "Entire Array",
                             "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), "
                             "entire array is to be used");
    RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */

    /* Keyframing Settings */
    rna_def_common_keying_flags(srna, 0);
}
开发者ID:RiazAhamed,项目名称:NewBlender,代码行数:64,代码来源:rna_animation.c


示例5: rna_def_image_preview

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

	srna = RNA_def_struct(brna, "ImagePreview", NULL);
	RNA_def_struct_sdna(srna, "PreviewImage");
	RNA_def_struct_ui_text(srna, "Image Preview", "Preview image and icon");

	prop = RNA_def_property(srna, "is_image_custom", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_PREVIEW]", PRV_USER_EDITED);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_image_custom_set");
	RNA_def_property_ui_text(prop, "Custom Image", "True if this preview image has been modified by py script,"
	                         "and is no more auto-generated by Blender");

	prop = RNA_def_int_vector(srna, "image_size", 2, NULL, 0, 0, "Image Size",
	                          "Width and height in pixels", 0, 0);
	RNA_def_property_subtype(prop, PROP_PIXEL);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_size_get", "rna_ImagePreview_image_size_set", NULL);

	prop = RNA_def_property(srna, "image_pixels", PROP_INT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Image Pixels", "Image pixels, as bytes (always RGBA 32bits)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_get_length");
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_pixels_get", "rna_ImagePreview_image_pixels_set", NULL);

	prop = RNA_def_property(srna, "image_pixels_float", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Float Image Pixels",
	                         "Image pixels components, as floats (RGBA concatenated values)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_float_get_length");
	RNA_def_property_float_funcs(prop, "rna_ImagePreview_image_pixels_float_get",
	                             "rna_ImagePreview_image_pixels_float_set", NULL);


	prop = RNA_def_property(srna, "is_icon_custom", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_ICON]", PRV_USER_EDITED);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_icon_custom_set");
	RNA_def_property_ui_text(prop, "Custom Icon", "True if this preview icon has been modified by py script,"
	                         "and is no more auto-generated by Blender");

	prop = RNA_def_int_vector(srna, "icon_size", 2, NULL, 0, 0, "Icon Size",
	                          "Width and height in pixels", 0, 0);
	RNA_def_property_subtype(prop, PROP_PIXEL);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_size_get", "rna_ImagePreview_icon_size_set", NULL);

	prop = RNA_def_property(srna, "icon_pixels", PROP_INT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Icon Pixels", "Icon pixels, as bytes (always RGBA 32bits)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_get_length");
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_pixels_get", "rna_ImagePreview_icon_pixels_set", NULL);

	prop = RNA_def_property(srna, "icon_pixels_float", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Float Icon Pixels", "Icon pixels components, as floats (RGBA concatenated values)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_float_get_length");
	RNA_def_property_float_funcs(prop, "rna_ImagePreview_icon_pixels_float_get",
	                             "rna_ImagePreview_icon_pixels_float_set", NULL);

	prop = RNA_def_int(srna, "icon_id", 0, INT_MIN, INT_MAX, "Icon ID",
	                   "Unique integer identifying this preview as an icon (zero means invalid)", INT_MIN, INT_MAX);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_id_get", NULL, NULL);

	func = RNA_def_function(srna, "reload", "rna_ImagePreview_icon_reload");
	RNA_def_function_ui_description(func, "Reload the preview from its source path");
}
开发者ID:mauge123,项目名称:mechanical-blender,代码行数:72,代码来源:rna_ID.c


示例6: RNA_def_gameproperty

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

	/* Base Struct for GameProperty */
	srna = RNA_def_struct(brna, "GameProperty", NULL);
	RNA_def_struct_ui_text(srna, "Game Property", "Game engine user defined object property");
	RNA_def_struct_sdna(srna, "bProperty");
	RNA_def_struct_refine_func(srna, "rna_GameProperty_refine");

	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, gameproperty_type_items);
	RNA_def_property_ui_text(prop, "Type", "");
	RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG);
	RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* GameBooleanProperty */
	srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
	RNA_def_struct_ui_text(srna, "Game Boolean Property", "Game engine user defined Boolean property");
	RNA_def_struct_sdna(srna, "bProperty");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "data", 1);
	RNA_def_property_ui_text(prop, "Value", "Property value");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* GameIntProperty */
	srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty");
	RNA_def_struct_ui_text(srna, "Game Integer Property", "Game engine user defined integer number property");
	RNA_def_struct_sdna(srna, "bProperty");

	prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "data");
	RNA_def_property_ui_text(prop, "Value", "Property value");
	RNA_def_property_range(prop, -10000, 10000);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* GameFloatProperty */
	srna = RNA_def_struct(brna, "GameFloatProperty", "GameProperty");
	RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property");
	RNA_def_struct_sdna(srna, "bProperty");

	prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
	/* RNA_def_property_float_sdna(prop, NULL, "data"); */
	RNA_def_property_ui_text(prop, "Value", "Property value");
	RNA_def_property_range(prop, -10000, 10000);
	RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* GameTimerProperty */
	srna = RNA_def_struct(brna, "GameTimerProperty", "GameProperty");
	RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property");
	RNA_def_struct_sdna(srna, "bProperty");

	prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
	/* RNA_def_property_float_sdna(prop, NULL, "data"); */
	RNA_def_property_ui_text(prop, "Value", "Property value");
	RNA_def_property_range(prop, -10000, 10000);
	RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* GameStringProperty */
	srna = RNA_def_struct(brna, "GameStringProperty", "GameProperty");
	RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property");
	RNA_def_struct_sdna(srna, "bProperty");

	prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "poin");
	RNA_def_property_string_maxlength(prop, MAX_PROPSTRING);
	RNA_def_property_ui_text(prop, "Value", "Property value");
	RNA_def_property_update(prop, NC_LOGIC, NULL);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:85,代码来源:rna_property.c


示例7: rna_def_movieclip_proxy

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

	static const EnumPropertyItem clip_tc_items[]= {
		{IMB_TC_NONE, "NONE", 0, "No TC in use", ""},
		{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
		{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
		{IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "Interpolate a global timestamp using the record date and time written by recording device"},
		{IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps", "Record run, but ignore timecode, changes in framerate or dropouts"},
		{0, NULL, 0, NULL, NULL}};

	srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
	RNA_def_struct_ui_text(srna, "Movie Clip Proxy", "Proxy parameters for a movie clip");
	RNA_def_struct_sdna(srna, "MovieClipProxy");

	/* build proxy sized */
	prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25);
	RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension");

	prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50);
	RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension");

	prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75);
	RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension");

	prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100);
	RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");

	prop= RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25);
	RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension");

	prop= RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50);
	RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension");

	prop= RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75);
	RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension");

	prop= RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100);
	RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original undistorted footage dimension");

	/* build timecodes */
	prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN);
	RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");

	prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN);
	RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");

	prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN);
	RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");

	/* quality of proxied image */
	prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "quality");
	RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images");
	RNA_def_property_ui_range(prop, 1, 100, 1, 0);

	prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "tc");
	RNA_def_property_enum_items(prop, clip_tc_items);
	RNA_def_property_ui_text(prop, "Timecode", "");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);

	/* directory */
	prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
	RNA_def_property_string_sdna(prop, NULL, "dir");
	RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
}
开发者ID:ryden,项目名称:blender-mirror,代码行数:81,代码来源:rna_movieclip.c


示例8: rna_def_dopesheet

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

	srna = RNA_def_struct(brna, "DopeSheet", NULL);
	RNA_def_struct_sdna(srna, "bDopeSheet");
	RNA_def_struct_ui_text(srna, "Dope Sheet", "Settings for filtering the channels shown in animation editors");
	
	/* Source of DopeSheet data */
	/* XXX: make this obsolete? */
	prop = RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "ID");
	RNA_def_property_ui_text(prop, "Source",
	                         "ID-Block representing source data, usually ID_SCE (i.e. Scene)");
	
	/* Show data-block filters */
	prop = RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS);
	RNA_def_property_ui_text(prop, "Show Datablock Filters",
	                         "Show options for whether channels related to certain types of data are included");
	RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN, NULL);
	
	/* General Filtering Settings */
	prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL);
	RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
	RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN);
	RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that are not visible");
	RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	prop = RNA_def_property(srna, "use_datablock_sort", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_NO_DB_SORT);
	RNA_def_property_ui_text(prop, "Sort Data-Blocks",
	                         "Alphabetically sorts data-blocks - mainly objects in the scene "
	                         "(disable to increase viewport speed)");
	RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	/* Debug Filtering Settings */
	prop = RNA_def_property(srna, "show_only_errors", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLY_ERRORS);
	RNA_def_property_ui_text(prop, "Show Errors", "Only include F-Curves and drivers that are disabled or have errors");
	RNA_def_property_ui_icon(prop, ICON_HELP, 0); /* XXX: this doesn't quite fit */
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	/* Object Group Filtering Settings */
	prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
	RNA_def_property_ui_text(prop, "Only Objects in Group",
	                         "Only include channels from objects in the specified group");
	RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	prop = RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Filtering Group", "Group that included object should be a member of");
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	/* FCurve Display Name Search Settings */
	prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME);
	RNA_def_property_ui_text(prop, "Only Matching F-Curves",
	                         "Only include F-Curves with names containing search text");
	RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	prop = RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "searchstr");
	RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string");
	RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	/* NLA Name Search Settings (Shared with FCurve setting, but with different labels) */
	prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME);
	RNA_def_property_ui_text(prop, "Only Matching Channels",
	                         "Only include channels with names containing search text");
	RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "searchstr");
	RNA_def_property_ui_text(prop, "Name Filter", "Live filtering string");
	RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE);
	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
	
	/* Multi-word fuzzy search option for name/text filters */
	prop = RNA_def_property(srna, "use_multi_word_filter", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_FUZZY_NAMES);
	RNA_def_property_ui_text(prop, "Multi-Word Fuzzy Filter",
	                         "Perform fuzzy/multi-word matching (WARNING: May be slow)");
	RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0);
//.........这里部分代码省略.........
开发者ID:diekev,项目名称:blender,代码行数:101,代码来源:rna_action.c


示例9: rna_def_keyblock

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

	srna = RNA_def_struct(brna, "ShapeKey", NULL);
	RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock");
	RNA_def_struct_sdna(srna, "KeyBlock");
	RNA_def_struct_path_func(srna, "rna_ShapeKey_path");
	RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);

	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Name", "Name of Shape Key");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set");
	RNA_def_struct_name_property(srna, prop);

	/* keys need to be sorted to edit this */
	prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_float_sdna(prop, NULL, "pos");
	RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");
	
	/* for now, this is editable directly, as users can set this even if they're not animating them
	 * (to test results) */
	prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR);
	RNA_def_property_float_sdna(prop, NULL, "curval");
	RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range");
	RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3);
	RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "type");
	RNA_def_property_enum_items(prop, keyblock_type_items);
	RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type for absolute shape keys");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "vgroup");
	RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "ShapeKey");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get",
	                               "rna_ShapeKey_relative_key_set", NULL, NULL);
	RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE);
	RNA_def_property_ui_text(prop, "Mute", "Mute this shape key");
	RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "slidermin");
	RNA_def_property_range(prop, -10.0f, 10.0f);
	RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range");
	RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider");

	prop = RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "slidermax");
	RNA_def_property_range(prop, -10.0f, 10.0f);
	RNA_def_property_float_default(prop, 1.0f);
	RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range");
	RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider");

	prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");
	RNA_def_property_struct_type(prop, "UnknownType");
	RNA_def_property_ui_text(prop, "Data", "");
	RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get",
	                                  "rna_ShapeKey_data_length", NULL, NULL, NULL);
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:77,代码来源:rna_key.c


示例10: 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, "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, 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", PRO 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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