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

C++ RNA_def_property_struct_type函数代码示例

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

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



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

示例1: rna_def_nlatrack

static void rna_def_nlatrack(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	
	srna = RNA_def_struct(brna, "NlaTrack", NULL);
	RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips");
	RNA_def_struct_ui_icon(srna, ICON_NLA);
	
	/* strips collection */
	prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(prop, "NlaStrip");
	RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");

	rna_api_nlatrack_strips(brna, prop);

	/* name property */
	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Name", "");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
	
	/* settings */
	prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
	/* can be made editable by hooking it up to the necessary NLA API methods */
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE);
	RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
	
	prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
	/* can be made editable by hooking it up to the necessary NLA API methods */
	RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO);
	RNA_def_property_ui_text(prop, "Solo",
	                         "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the "
	                         "same AnimData block are disabled)");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
	RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaTrack_solo_set");

	prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED);
	RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
	
	prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED);
	RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");

	prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
	RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
	RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
}
开发者ID:mgschwan,项目名称:blensor,代码行数:54,代码来源:rna_nla.c


示例2: rna_def_maskParent

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

	static EnumPropertyItem mask_id_type_items[] = {
		{ID_MC, "MOVIECLIP", ICON_SEQUENCE, "Movie Clip", ""},
		{0, NULL, 0, NULL, NULL}};

	static EnumPropertyItem parent_type_items[] = {
		{MASK_PARENT_POINT_TRACK, "POINT_TRACK", 0, "Point Track", ""},
		{MASK_PARENT_PLANE_TRACK, "PLANE_TRACK", 0, "Plane Track", ""},
		{0, NULL, 0, NULL, NULL}};

	srna = RNA_def_struct(brna, "MaskParent", NULL);
	RNA_def_struct_ui_text(srna, "Mask Parent", "Parenting settings for masking element");

	/* Target Properties - ID-block to Drive */
	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_maskSpline_id_editable");
	/* note: custom set function is ONLY to avoid rna setting a user for this. */
	RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskParent_id_set", "rna_MaskParent_id_typef", NULL);
	RNA_def_property_ui_text(prop, "ID", "ID-block to which masking element would be parented to or to it's property");
	RNA_def_property_update(prop, 0, "rna_Mask_update_parent");

	prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "id_type");
	RNA_def_property_enum_items(prop, mask_id_type_items);
	RNA_def_property_enum_default(prop, ID_MC);
	RNA_def_property_enum_funcs(prop, NULL, "rna_MaskParent_id_type_set", NULL);
	//RNA_def_property_editable_func(prop, "rna_MaskParent_id_type_editable");
	RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
	RNA_def_property_update(prop, 0, "rna_Mask_update_parent");

	/* type */
	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, parent_type_items);
	RNA_def_property_ui_text(prop, "Parent Type", "Parent Type");
	RNA_def_property_update(prop, 0, "rna_Mask_update_parent");

	/* parent */
	prop = RNA_def_property(srna, "parent", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Parent", "Name of parent object in specified data block to which parenting happens");
	RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
	RNA_def_property_update(prop, 0, "rna_Mask_update_parent");

	/* sub_parent */
	prop = RNA_def_property(srna, "sub_parent", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Sub Parent", "Name of parent sub-object in specified data block to which parenting happens");
	RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
	RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
}
开发者ID:ilent2,项目名称:Blender-Billboard-Modifier,代码行数:54,代码来源:rna_mask.c


示例3: rna_def_mask_splines

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

	srna = RNA_def_struct(brna, "MaskSplines", NULL);
	RNA_def_struct_sdna(srna, "MaskLayer");
	RNA_def_struct_ui_text(srna, "Mask Splines", "Collection of masking splines");

	/* Create new spline */
	func = RNA_def_function(srna, "new", "rna_MaskLayer_spline_new");
	RNA_def_function_flag(func, FUNC_USE_SELF_ID);
	RNA_def_function_ui_description(func, "Add a new spline to the layer");
	parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The newly created spline");
	RNA_def_function_return(func, parm);

	/* Remove the spline */
	func = RNA_def_function(srna, "remove", "rna_MaskLayer_spline_remove");
	RNA_def_function_flag(func, FUNC_USE_SELF_ID);
	RNA_def_function_ui_description(func, "Remove a spline from a layer");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The spline to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);

	/* active spline */
	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MaskSpline");
	RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_get", "rna_MaskLayer_active_spline_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
	RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer");

	/* active point */
	prop = RNA_def_property(srna, "active_point", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MaskSplinePoint");
	RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_point_get", "rna_MaskLayer_active_spline_point_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
	RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer");
}
开发者ID:ilent2,项目名称:Blender-Billboard-Modifier,代码行数:41,代码来源:rna_mask.c


示例4: rna_def_render_result

static void rna_def_render_result(BlenderRNA *brna)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;
	
	srna = RNA_def_struct(brna, "RenderResult", NULL);
	RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");

	func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
	RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_string_file_name(func, "filename", NULL, FILE_MAX, "File Name",
	                                "Filename to load into this render tile, must be no smaller than "
	                                "the render result");
	RNA_def_property_flag(parm, PROP_REQUIRED);

	RNA_define_verify_sdna(0);

	parm = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
	RNA_def_property_int_sdna(parm, NULL, "rectx");
	RNA_def_property_clear_flag(parm, PROP_EDITABLE);

	parm = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
	RNA_def_property_int_sdna(parm, NULL, "recty");
	RNA_def_property_clear_flag(parm, PROP_EDITABLE);

	parm = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(parm, "RenderLayer");
	RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next",
	                                  "rna_iterator_listbase_end", "rna_iterator_listbase_get",
	                                  NULL, NULL, NULL, NULL);

	parm = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(parm, "RenderView");
	RNA_def_property_collection_funcs(parm, "rna_RenderResult_views_begin", "rna_iterator_listbase_next",
	                                  "rna_iterator_listbase_end", "rna_iterator_listbase_get",
	                                  NULL, NULL, NULL, NULL);

	RNA_define_verify_sdna(1);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:41,代码来源:rna_render.c


示例5: rna_def_menu

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

    srna= RNA_def_struct(brna, "Menu", NULL);
    RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons");
    RNA_def_struct_sdna(srna, "Menu");
    RNA_def_struct_refine_func(srna, "rna_Menu_refine");
    RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister", NULL);

    /* poll */
    func= RNA_def_function(srna, "poll", NULL);
    RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn");
    RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
    RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
    parm= RNA_def_pointer(func, "context", "Context", "", "");
    RNA_def_property_flag(parm, PROP_REQUIRED);

    /* draw */
    func= RNA_def_function(srna, "draw", NULL);
    RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout");
    RNA_def_function_flag(func, FUNC_REGISTER);
    parm= RNA_def_pointer(func, "context", "Context", "", "");
    RNA_def_property_flag(parm, PROP_REQUIRED);

    RNA_define_verify_sdna(0); // not in sdna

    prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
    RNA_def_property_pointer_sdna(prop, NULL, "layout");
    RNA_def_property_struct_type(prop, "UILayout");
    RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI");

    /* registration */
    prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
    RNA_def_property_string_sdna(prop, NULL, "type->idname");
    RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
    RNA_def_property_ui_text(prop, "ID Name",
                             "If this is set, the menu gets a custom ID, otherwise it takes the "
                             "name of the class used to define the menu (for example, if the "
                             "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
                             "script, then bl_idname = \"OBJECT_MT_hello\")");

    prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
    RNA_def_property_string_sdna(prop, NULL, "type->label");
    RNA_def_property_flag(prop, PROP_REGISTER);
    RNA_def_property_ui_text(prop, "Label", "The menu label");

    RNA_define_verify_sdna(1);
}
开发者ID:BHCLL,项目名称:blendocv,代码行数:52,代码来源:rna_ui.c


示例6: rna_def_scopes

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

	static EnumPropertyItem prop_wavefrm_mode_items[] = {
		{SCOPES_WAVEFRM_LUMA, "LUMA", ICON_COLOR, "Luma", ""},
		{SCOPES_WAVEFRM_RGB_PARADE, "PARADE", ICON_COLOR, "Parade", ""},
		{SCOPES_WAVEFRM_YCC_601, "YCBCR601", ICON_COLOR, "YCbCr (ITU 601)", ""},
		{SCOPES_WAVEFRM_YCC_709, "YCBCR709", ICON_COLOR, "YCbCr (ITU 709)", ""},
		{SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""},
		{SCOPES_WAVEFRM_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "Scopes", NULL);
	RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image");
	
	prop = RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1);
	RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image");
	RNA_def_property_update(prop, 0, "rna_Scopes_update");
	
	prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE);
	RNA_def_property_float_sdna(prop, "Scopes", "accuracy");
	RNA_def_property_range(prop, 0.0, 100.0);
	RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
	RNA_def_property_ui_text(prop, "Accuracy", "Proportion of original image source pixel lines to sample");
	RNA_def_property_update(prop, 0, "rna_Scopes_update");

	prop = RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, "Scopes", "hist");
	RNA_def_property_struct_type(prop, "Histogram");
	RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics");

	prop = RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, "Scopes", "wavefrm_mode");
	RNA_def_property_enum_items(prop, prop_wavefrm_mode_items);
	RNA_def_property_ui_text(prop, "Waveform Mode", "");
	RNA_def_property_update(prop, 0, "rna_Scopes_update");

	prop = RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_FACTOR);
	RNA_def_property_float_sdna(prop, "Scopes", "wavefrm_alpha");
	RNA_def_property_range(prop, 0, 1);
	RNA_def_property_ui_text(prop, "Waveform Opacity", "Opacity of the points");

	prop = RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_FACTOR);
	RNA_def_property_float_sdna(prop, "Scopes", "vecscope_alpha");
	RNA_def_property_range(prop, 0, 1);
	RNA_def_property_ui_text(prop, "Vectorscope Opacity", "Opacity of the points");
}
开发者ID:diekev,项目名称:blender,代码行数:51,代码来源:rna_color.c


示例7: rna_def_gpencil_data

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

	static EnumPropertyItem draw_mode_items[] = {
		{GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"},
		{0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_DATA_VIEWALIGN is inverted */
		{GP_DATA_VIEWALIGN | GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"},
		{GP_DATA_VIEWALIGN | GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "GreasePencil", "ID");
	RNA_def_struct_sdna(srna, "bGPdata");
	RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook");
	RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL);
	
	/* Layers */
	prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
	RNA_def_property_struct_type(prop, "GPencilLayer");
	RNA_def_property_ui_text(prop, "Layers", "");
	rna_def_gpencil_layers_api(brna, prop);
	
	/* Animation Data */
	rna_def_animdata_common(srna);
	
	/* Flags */
	prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
	RNA_def_property_enum_items(prop, draw_mode_items);
	RNA_def_property_ui_text(prop, "Draw Mode", "");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS);
	RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
	
	prop = RNA_def_property(srna, "use_stroke_edit_mode", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_STROKE_EDITMODE);
	RNA_def_property_ui_text(prop, "Stroke Edit Mode", "Enable alternative keymap to make editing stroke points easier");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_update");
	
	/* API Functions */
	func = RNA_def_function(srna, "clear", "rna_GPencil_clear");
	RNA_def_function_ui_description(func, "Remove all the grease pencil data");
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:50,代码来源:rna_gpencil.c


示例8: rna_def_palette

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

	srna = RNA_def_struct(brna, "Palette", "ID");
	RNA_def_struct_ui_text(srna, "Palette", "");
	RNA_def_struct_ui_icon(srna, ICON_COLOR);

	prop = RNA_def_property(srna, "colors", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(prop, "PaletteColor");
	RNA_def_property_ui_text(prop, "Palette Color", "Colors that are part of this palette");
	RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
}
开发者ID:floored,项目名称:blender,代码行数:14,代码来源:rna_sculpt_paint.c


示例9: rna_def_animviz

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

    srna= RNA_def_struct(brna, "AnimViz", NULL);
    RNA_def_struct_sdna(srna, "bAnimVizSettings");
    RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion");

    /* onion-skinning settings (nested struct) */
    prop= RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
    RNA_def_property_flag(prop, PROP_NEVER_NULL);
    RNA_def_property_struct_type(prop, "AnimVizOnionSkinning");
    RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL);
    RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation");

    /* motion path settings (nested struct) */
    prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
    RNA_def_property_flag(prop, PROP_NEVER_NULL);
    RNA_def_property_struct_type(prop, "AnimVizMotionPaths");
    RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL);
    RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualisation");
}
开发者ID:mik0001,项目名称:Blender,代码行数:23,代码来源:rna_animviz.c


示例10: rna_def_layer_objects

static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
{
  StructRNA *srna;
  PropertyRNA *prop;

  RNA_def_property_srna(cprop, "LayerObjects");
  srna = RNA_def_struct(brna, "LayerObjects", NULL);
  RNA_def_struct_sdna(srna, "ViewLayer");
  RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects");

  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
  RNA_def_property_struct_type(prop, "Object");
  RNA_def_property_pointer_funcs(prop,
                                 "rna_LayerObjects_active_object_get",
                                 "rna_LayerObjects_active_object_set",
                                 NULL,
                                 NULL);
  RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
  RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer");
  /* Could call: ED_object_base_activate(C, rl->basact);
   * but would be a bad level call and it seems the notifier is enough */
  RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL);

  prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE);
  RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
  RNA_def_property_struct_type(prop, "Object");
  RNA_def_property_collection_funcs(prop,
                                    "rna_LayerObjects_selected_begin",
                                    "rna_iterator_listbase_next",
                                    "rna_iterator_listbase_end",
                                    "rna_ViewLayer_objects_get",
                                    NULL,
                                    NULL,
                                    NULL,
                                    NULL);
  RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer");
}
开发者ID:dfelinto,项目名称:blender,代码行数:37,代码来源:rna_layer.c


示例11: rna_def_lamp_mtex

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

	static const EnumPropertyItem prop_texture_coordinates_items[] = {
		{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
		{TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the texture coordinates"},
		{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
		{0, NULL, 0, NULL, NULL}
	};

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

	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, prop_texture_coordinates_items);
	RNA_def_property_ui_text(prop, "Texture Coordinates", "");

	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");

	prop = RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
	RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
	RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "color_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, "Color Factor", "Amount texture affects color values");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shadowfac");
	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
	RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
开发者ID:mgschwan,项目名称:blensor,代码行数:49,代码来源:rna_lamp.c


示例12: rna_def_area_spaces

/* Area.spaces */
static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	RNA_def_property_srna(cprop, "AreaSpaces");
	srna = RNA_def_struct(brna, "AreaSpaces", NULL);
	RNA_def_struct_sdna(srna, "ScrArea");
	RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces");

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first");
	RNA_def_property_struct_type(prop, "Space");
	RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
}
开发者ID:wchargin,项目名称:blender,代码行数:16,代码来源:rna_screen.c


示例13: rna_def_key

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

	srna = RNA_def_struct(brna, "Key", "ID");
	RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks");
	RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);

	prop = RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
	RNA_def_property_flag(prop, PROP_NEVER_NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_pointer_sdna(prop, NULL, "refkey");
	RNA_def_property_ui_text(prop, "Reference Key", "");

	prop = RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "block", NULL);
	RNA_def_property_struct_type(prop, "ShapeKey");
	RNA_def_property_ui_text(prop, "Key Blocks", "Shape keys");

	rna_def_animdata_common(srna);

	prop = RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
	RNA_def_property_flag(prop, PROP_NEVER_NULL);
	RNA_def_property_pointer_sdna(prop, NULL, "from");
	RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys");

	prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE);
	RNA_def_property_ui_text(prop, "Relative",
	                         "Make shape keys relative, "
	                         "otherwise play through shapes as a sequence using the evaluation time");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "ctime");
	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
	RNA_def_property_ui_text(prop, "Evaluation Time", "Evaluation time for absolute shape keys");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");

	prop = RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "slurph");
	RNA_def_property_range(prop, -500, 500);
	RNA_def_property_ui_text(prop, "Slurph",
	                         "Create a delay (in frames) in applying key positions, first vertex goes first");
	RNA_def_property_update(prop, 0, "rna_Key_update_data");
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:47,代码来源:rna_key.c


示例14: rna_def_header

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

	srna = RNA_def_struct(brna, "Header", NULL);
	RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements");
	RNA_def_struct_sdna(srna, "Header");
	RNA_def_struct_refine_func(srna, "rna_Header_refine");
	RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL);
	RNA_def_struct_flag(srna, STRUCT_PUBLIC_NAMESPACE_INHERIT);

	/* draw */
	func = RNA_def_function(srna, "draw", NULL);
	RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout");
	RNA_def_function_flag(func, FUNC_REGISTER);
	parm = RNA_def_pointer(func, "context", "Context", "", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);

	RNA_define_verify_sdna(0); /* not in sdna */

	prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "layout");
	RNA_def_property_struct_type(prop, "UILayout");
	RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI");

	/* registration */
	prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "type->idname");
	RNA_def_property_flag(prop, PROP_REGISTER);
	RNA_def_property_ui_text(prop, "ID Name",
	                         "If this is set, the header gets a custom ID, otherwise it takes the "
	                         "name of the class used to define the panel; for example, if the "
	                         "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
	                         "script, then bl_idname = \"OBJECT_HT_hello\"");

	prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
	RNA_def_property_enum_items(prop, rna_enum_space_type_items);
	RNA_def_property_flag(prop, PROP_REGISTER);
	RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in");

	RNA_define_verify_sdna(1);
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:46,代码来源:rna_ui.c


示例15: rna_def_mask

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

	rna_def_mask_layer(brna);

	srna = RNA_def_struct(brna, "Mask", "ID");
	RNA_def_struct_ui_text(srna, "Mask", "Mask datablock defining mask for compositing");
	RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);

	/* mask layers */
	prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_funcs(prop, "rna_Mask_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
	RNA_def_property_struct_type(prop, "MaskLayer");
	RNA_def_property_ui_text(prop, "Layers", "Collection of layers which defines this mask");
	rna_def_masklayers(brna, prop);

	/* active masklay index */
	prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "masklay_act");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_funcs(prop, "rna_Mask_layer_active_index_get", "rna_Mask_layer_active_index_set", "rna_Mask_layer_active_index_range");
	RNA_def_property_ui_text(prop, "Active Shape Index", "Index of active layer in list of all mask's layers");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	/* frame range */
	prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_sdna(prop, NULL, "sfra");
	RNA_def_property_int_funcs(prop, NULL, "rna_Mask_start_frame_set", NULL);
	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
	RNA_def_property_ui_text(prop, "Start Frame", "First frame of the mask (used for sequencer)");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_sdna(prop, NULL, "efra");
	RNA_def_property_int_funcs(prop, NULL, "rna_Mask_end_frame_set", NULL);
	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
	RNA_def_property_ui_text(prop, "End Frame", "Final frame of the mask (used for sequencer)");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	/* pointers */
	rna_def_animdata_common(srna);
}
开发者ID:ilent2,项目名称:Blender-Billboard-Modifier,代码行数:46,代码来源:rna_mask.c


示例16: rna_def_render_bake_pixel

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

	srna = RNA_def_struct(brna, "BakePixel", NULL);
	RNA_def_struct_ui_text(srna, "Bake Pixel", "");

	RNA_define_verify_sdna(0);

	prop = RNA_def_property(srna, "primitive_id", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "primitive_id");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "object_id", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "object_id");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
	RNA_def_property_array(prop, 2);
	RNA_def_property_float_sdna(prop, NULL, "uv");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "du_dx", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "du_dx");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "du_dy", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "du_dy");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "dv_dx", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "dv_dx");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "dv_dy", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "dv_dy");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "next", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "BakePixel");
	RNA_def_property_pointer_funcs(prop, "rna_BakePixel_next_get", NULL, NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	RNA_define_verify_sdna(1);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:46,代码来源:rna_render.c


示例17: rna_def_gpencil_stroke

static void rna_def_gpencil_stroke(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	
	srna= RNA_def_struct(brna, "GPencilStroke", NULL);
	RNA_def_struct_sdna(srna, "bGPDstroke");
	RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch");
	
	/* Points */
	prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
	RNA_def_property_struct_type(prop, "GPencilStrokePoint");
	RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
	
	/* Flags - Readonly type-info really... */
	// TODO...
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:18,代码来源:rna_gpencil.c


示例18: rna_def_touch_sensor

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

	srna = RNA_def_struct(brna, "TouchSensor", "Sensor");
	RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object");
	RNA_def_struct_sdna_from(srna, "bTouchSensor", "data");

	prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "Material");
	RNA_def_property_pointer_sdna(prop, NULL, "ma");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
	/* note: custom set function is ONLY to avoid rna setting a user for this. */
	RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL, NULL);
	RNA_def_property_update(prop, NC_LOGIC, NULL);
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:18,代码来源:rna_sensor.c


示例19: rna_def_armature_edit_bones

/* armature.bones.* */
static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "ArmatureEditBones");
	srna = RNA_def_struct(brna, "ArmatureEditBones", NULL);
	RNA_def_struct_sdna(srna, "bArmature");
	RNA_def_struct_ui_text(srna, "Armature E 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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