Example #1
0
void RNA_api_sequence_elements(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	RNA_def_property_srna(cprop, "SequenceElements");
	srna = RNA_def_struct(brna, "SequenceElements", NULL);
	RNA_def_struct_sdna(srna, "Sequence");
	RNA_def_struct_ui_text(srna, "SequenceElements", "Collection of SequenceElement");

	func = RNA_def_function(srna, "append", "rna_SequenceElements_append");
	RNA_def_function_flag(func, FUNC_USE_SELF_ID);
	RNA_def_function_ui_description(func, "Push an image from ImageSequence.directory");
	parm = RNA_def_string(func, "filename", "File", 0, "", "Filepath to image");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm = RNA_def_pointer(func, "elem", "SequenceElement", "", "New SequenceElement");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "pop", "rna_SequenceElements_pop");
	RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
	RNA_def_function_ui_description(func, "Pop an image off the collection");
	parm = RNA_def_int(func, "index", -1, INT_MIN, INT_MAX, "", "Index of image to remove", INT_MIN, INT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #2
0
static void rna_def_render_passes(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "RenderPasses");
	srna = RNA_def_struct(brna, "RenderPasses", NULL);
	RNA_def_struct_sdna(srna, "RenderLayer");
	RNA_def_struct_ui_text(srna, "Render Passes", "Collection of render passes");

	func = RNA_def_function(srna, "find_by_type", "rna_RenderPass_find_by_type");
	RNA_def_function_ui_description(func, "Get the render pass for a given type and view");
	parm = RNA_def_enum(func, "pass_type", rna_enum_render_pass_type_items, SCE_PASS_COMBINED, "Pass", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_string(func, "view", NULL, 0, "View", "Render view to get pass from");  /* NULL ok here */
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "find_by_name", "rna_RenderPass_find_by_name");
	RNA_def_function_ui_description(func, "Get the render pass for a given name and view");
	parm = RNA_def_string(func, "name", RE_PASSNAME_COMBINED, 0, "Pass", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_string(func, "view", NULL, 0, "View", "Render view to get pass from");  /* NULL ok here */
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass");
	RNA_def_function_return(func, parm);
}
Example #3
0
static void rna_def_render_slots(BlenderRNA *brna, PropertyRNA *cprop)
{
  StructRNA *srna;
  FunctionRNA *func;
  PropertyRNA *prop, *parm;

  RNA_def_property_srna(cprop, "RenderSlots");
  srna = RNA_def_struct(brna, "RenderSlots", NULL);
  RNA_def_struct_sdna(srna, "Image");
  RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");

  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_sdna(prop, NULL, "render_slot");
  RNA_def_property_int_funcs(prop,
                             "rna_render_slots_active_index_get",
                             "rna_render_slots_active_index_set",
                             "rna_render_slots_active_index_range");
  RNA_def_property_ui_text(prop, "Active", "Active render slot of the image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
  RNA_def_property_struct_type(prop, "RenderSlot");
  RNA_def_property_pointer_funcs(
      prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL);
  RNA_def_property_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Active", "Active render slot of the image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  func = RNA_def_function(srna, "new", "BKE_image_add_renderslot");
  RNA_def_function_ui_description(func, "Add a render slot to the image");
  parm = RNA_def_string(func, "name", NULL, 0, "Name", "New name for the render slot");
  parm = RNA_def_pointer(func, "result", "RenderSlot", "", "Newly created render layer");
  RNA_def_function_return(func, parm);
}
Example #4
0
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	RNA_def_property_srna(cprop, "NlaStrips");
	srna= RNA_def_struct(brna, "NlaStrips", NULL);
	RNA_def_struct_sdna(srna, "NlaTrack");
	RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");

	func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track");
	parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip.", INT_MIN, INT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
	/* return type */
	parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip.");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove a NLA Strip.");
	parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
Example #5
0
static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	RNA_def_property_srna(cprop, "ColorRampElements");
	srna = RNA_def_struct(brna, "ColorRampElements", NULL);
	RNA_def_struct_sdna(srna, "ColorBand");
	RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
	RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements");

	/* TODO, make these functions generic in texture.c */
	func = RNA_def_function(srna, "new", "rna_ColorRampElement_new");
	RNA_def_function_ui_description(func, "Add element to ColorRamp");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "New element");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove");
	RNA_def_function_ui_description(func, "Delete element from ColorRamp");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
Example #6
0
static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	PropertyRNA *prop;
	
	RNA_def_property_srna(cprop, "NlaTracks");
	srna = RNA_def_struct(brna, "NlaTracks", NULL);
	RNA_def_struct_sdna(srna, "AnimData");
	RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks");
	
	func = RNA_def_function(srna, "new", "rna_NlaTrack_new");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
	RNA_def_function_ui_description(func, "Add a new NLA Track");
	RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after");
	/* return type */
	parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track");
	RNA_def_function_return(func, parm);
	
	func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
	RNA_def_function_ui_description(func, "Remove a NLA Track");
	parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "NlaTrack");
	RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint");
	/* XXX: should (but doesn't) update the active track in the NLA window */
	RNA_def_property_update(prop, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL);
}
Example #7
0
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataScenes");
	srna= RNA_def_struct(brna, "BlendDataScenes", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");

	func= RNA_def_function(srna, "new", "rna_Main_scenes_new");
	RNA_def_function_ui_description(func, "Add a new scene to the main database");
	parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove a scene from the current blendfile.");
	parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
Example #8
0
static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

//	FunctionRNA *func;
//	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "GreasePencilLayers");
	srna= RNA_def_struct(brna, "GreasePencilLayers", NULL);
	RNA_def_struct_sdna(srna, "bGPdata");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");

#if 0
	func= RNA_def_function(srna, "new", "rna_GPencil_layer_new");
	RNA_def_function_ui_description(func, "Add a new spline to the curve.");
	parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
	RNA_def_function_ui_description(func, "Remove a spline from a curve.");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
#endif

	prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "GreasePencil");
	RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer");
}
Example #9
0
/* mball.elements */
static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "MetaBallElements");
	srna = RNA_def_struct(brna, "MetaBallElements", NULL);
	RNA_def_struct_sdna(srna, "MetaBall");
	RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements");

	func = RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
	RNA_def_function_ui_description(func, "Add a new element to the metaball");
	RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element");
	parm = RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
	RNA_def_function_ui_description(func, "Remove an element from the metaball");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);

	func = RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear");
	RNA_def_function_ui_description(func, "Remove all elements from the metaball");

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
	RNA_def_property_ui_text(prop, "Active Element", "Last selected element");
}
Example #10
0
static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "GPencilFrames");
	srna = RNA_def_struct(brna, "GPencilFrames", NULL);
	RNA_def_struct_sdna(srna, "bGPDlayer");
	RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames");

	func = RNA_def_function(srna, "new", "rna_GPencil_frame_new");
	RNA_def_function_ui_description(func, "Add a new grease pencil frame");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_int(func, "frame_number", 1, MINFRAME, MAXFRAME, "Frame Number", "The frame on which this sketch appears", MINFRAME, MAXFRAME);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm = RNA_def_pointer(func, "frame", "GPencilFrame", "", "The newly created frame");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_GPencil_frame_remove");
	RNA_def_function_ui_description(func, "Remove a grease pencil frame");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "frame", "GPencilFrame", "Frame", "The frame to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);

	func = RNA_def_function(srna, "copy", "rna_GPencil_frame_copy");
	RNA_def_function_ui_description(func, "Copy a grease pencil frame");
	parm = RNA_def_pointer(func, "source", "GPencilFrame", "Source", "The source frame");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
	parm = RNA_def_pointer(func, "copy", "GPencilFrame", "", "The newly copied frame");
	RNA_def_function_return(func, parm);
}
Example #11
0
/* fcurve.keyframe_points */
static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
{
    StructRNA *srna;

    FunctionRNA *func;
    PropertyRNA *parm;

    RNA_def_property_srna(cprop, "ActionGroups");
    srna = RNA_def_struct(brna, "ActionGroups", NULL);
    RNA_def_struct_sdna(srna, "bAction");
    RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups");

    func = RNA_def_function(srna, "new", "rna_Action_groups_new");
    RNA_def_function_ui_description(func, "Add a keyframe to the curve");
    parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the action group");
    RNA_def_property_flag(parm, PROP_REQUIRED);

    parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group");
    RNA_def_function_return(func, parm);


    func = RNA_def_function(srna, "remove", "rna_Action_groups_remove");
    RNA_def_function_ui_description(func, "Remove action group");
    RNA_def_function_flag(func, FUNC_USE_REPORTS);
    parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove");
    RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
    RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
Example #12
0
static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
{
    StructRNA *srna;

    FunctionRNA *func;
    PropertyRNA *parm;

    RNA_def_property_srna(cprop, "ActionFCurves");
    srna = RNA_def_struct(brna, "ActionFCurves", NULL);
    RNA_def_struct_sdna(srna, "bAction");
    RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves");

    func = RNA_def_function(srna, "new", "rna_Action_fcurve_new");
    RNA_def_function_ui_description(func, "Add a keyframe to the F-Curve");
    RNA_def_function_flag(func, FUNC_USE_REPORTS);
    parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path to use");
    RNA_def_property_flag(parm, PROP_REQUIRED);
    RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
    RNA_def_string(func, "action_group", NULL, 0, "Action Group", "Acton group to add this F-Curve into");

    parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
    RNA_def_function_return(func, parm);


    func = RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
    RNA_def_function_ui_description(func, "Remove action group");
    RNA_def_function_flag(func, FUNC_USE_REPORTS);
    parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
    RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
    RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
Example #13
0
/* cachefile.object_paths */
static void rna_def_cachefile_object_paths(BlenderRNA *brna, PropertyRNA *cprop)
{
	RNA_def_property_srna(cprop, "AlembicObjectPaths");
	StructRNA *srna = RNA_def_struct(brna, "AlembicObjectPaths", NULL);
	RNA_def_struct_sdna(srna, "CacheFile");
	RNA_def_struct_ui_text(srna, "Object Paths", "Collection of object paths");
}
Example #14
0
static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "GreasePencilLayers");
	srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
	RNA_def_struct_sdna(srna, "bGPdata");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");

	func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
	RNA_def_function_ui_description(func, "Add a new grease pencil layer");
	parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer");
	parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
	RNA_def_function_ui_description(func, "Remove a grease pencil layer");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "GreasePencil");
	RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer");
}
Example #15
0
/* group.objects */
static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
/*	PropertyRNA *prop; */

	FunctionRNA *func;
	PropertyRNA *parm;
	
	RNA_def_property_srna(cprop, "GroupObjects");
	srna = RNA_def_struct(brna, "GroupObjects", NULL);
	RNA_def_struct_sdna(srna, "Group");
	RNA_def_struct_ui_text(srna, "Group Objects", "Collection of group objects");

	/* add object */
	func = RNA_def_function(srna, "link", "rna_Group_objects_link");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Add this object to a group");
	/* object to add */
	parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);

	/* remove object */
	func = RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");
	RNA_def_function_ui_description(func, "Remove this object to a group");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
	/* object to remove */
	parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #16
0
static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	/* PropertyRNA *prop; */
	
	RNA_def_property_srna(cprop, "AnimDataDrivers");
	srna = RNA_def_struct(brna, "AnimDataDrivers", NULL);
	RNA_def_struct_sdna(srna, "AnimData");
	RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves");
	
	/* AnimData.drivers.from_existing(...) */
	func = RNA_def_function(srna, "from_existing", "rna_Driver_from_existing");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
	RNA_def_function_ui_description(func, "Add a new driver given an existing one");
	RNA_def_pointer(func, "src_driver", "FCurve", "", "Existing Driver F-Curve to use as template for a new one");
	/* return type */
	parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve");
	RNA_def_function_return(func, parm);
	
	/* AnimData.drivers.find(...) */
	func = RNA_def_function(srna, "find", "rna_Driver_find");
	RNA_def_function_ui_description(func, "Find a driver F-Curve. Note that this function performs a linear scan "
	                                "of all driver F-Curves.");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
	/* return type */
	parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist");
	RNA_def_function_return(func, parm);
}
Example #17
0
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataTextures");
	srna= RNA_def_struct(brna, "BlendDataTextures", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups");

	func= RNA_def_function(srna, "new", "rna_Main_textures_new");
	RNA_def_function_ui_description(func, "Add a new texture to the main database");
	parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_Main_textures_remove");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove a texture from the current blendfile.");
	parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

	func= RNA_def_function(srna, "tag", "rna_Main_textures_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #18
0
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataFonts");
	srna= RNA_def_struct(brna, "BlendDataFonts", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");

	func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Load a new font into the main database");
	parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove a font from the current blendfile.");
	parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

	func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #19
0
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataMetaBalls");
	srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");

	func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
	RNA_def_function_ui_description(func, "Add a new metaball to the main database");
	parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
	parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

	func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #20
0
static void rna_def_curvemap_points_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	RNA_def_property_srna(cprop, "CurveMapPoints");
	srna = RNA_def_struct(brna, "CurveMapPoints", NULL);
	RNA_def_struct_sdna(srna, "CurveMap");
	RNA_def_struct_ui_text(srna, "Curve Map Point", "Collection of Curve Map Points");

	func = RNA_def_function(srna, "new", "curvemap_insert");
	RNA_def_function_ui_description(func, "Add point to CurveMap");
	parm = RNA_def_float(func, "position", 0.0f, -FLT_MAX, FLT_MAX, "Position", "Position to add point", -FLT_MAX, FLT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm = RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "Value", "Value of point", -FLT_MAX, FLT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm = RNA_def_pointer(func, "point", "CurveMapPoint", "", "New point");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_CurveMap_remove_point");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Delete point from CurveMap");
	parm = RNA_def_pointer(func, "point", "CurveMapPoint", "", "PointElement to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
Example #21
0
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataGreasePencils");
	srna= RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");

	func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #22
0
/* 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");
}
Example #23
0
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataWindowManagers");
	srna= RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");

	func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #24
0
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataSounds");
	srna= RNA_def_struct(brna, "BlendDataSounds", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");

	/* TODO, 'load' */

	func= RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "ActionFCurves");
	srna = RNA_def_struct(brna, "ActionFCurves", NULL);
	RNA_def_struct_sdna(srna, "bAction");
	RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves");

	/* Action.fcurves.new(...) */
	func = RNA_def_function(srna, "new", "rna_Action_fcurve_new");
	RNA_def_function_ui_description(func, "Add an F-Curve to the action");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path to use");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
	RNA_def_string(func, "action_group", NULL, 0, "Action Group", "Acton group to add this F-Curve into");

	parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
	RNA_def_function_return(func, parm);

	/* Action.fcurves.find(...) */
	func = RNA_def_function(srna, "find", "rna_Action_fcurve_find");
	RNA_def_function_ui_description(func, "Find an F-Curve. Note that this function performs a linear scan "
	                                "of all F-Curves in the action.");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);

	parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist");
	RNA_def_function_return(func, parm);

	/* Action.fcurves.remove(...) */
	func = RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
	RNA_def_function_ui_description(func, "Remove action group");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
Example #26
0
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "BlendDataImages");
	srna= RNA_def_struct(brna, "BlendDataImages", NULL);
	RNA_def_struct_sdna(srna, "Main");
	RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");

	func= RNA_def_function(srna, "new", "rna_Main_images_new");
	RNA_def_function_ui_description(func, "Add a new image to the main database");
	parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
	RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
	/* return type */
	parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "load", "rna_Main_images_load");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Load a new image into the main database");
	parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load.");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* return type */
	parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
	RNA_def_function_return(func, parm);

	func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
	parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

	func= RNA_def_function(srna, "tag", "rna_Main_images_tag");
	parm= RNA_def_boolean(func, "value", 0, "Value", "");
	RNA_def_property_flag(parm, PROP_REQUIRED);
}
Example #27
0
/* 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 EditBones", "Collection of armature edit bones");

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "EditBone");
	RNA_def_property_pointer_sdna(prop, NULL, "act_edbone");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone");
	/*RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); */
	RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL);

	/* todo, redraw */
/*		RNA_def_property_collection_active(prop, prop_act); */

	/* add target */
	func = RNA_def_function(srna, "new", "rna_Armature_edit_bone_new");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Add a new bone");
	parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the bone");
	RNA_def_property_flag(parm, PROP_REQUIRED);

	/* return type */
	parm = RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone");
	RNA_def_function_return(func, parm);

	/* remove target */
	func = RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_function_ui_description(func, "Remove an existing bone from the armature");
	/* target to remove*/
	parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "ActionPoseMarkers");
	srna = RNA_def_struct(brna, "ActionPoseMarkers", NULL);
	RNA_def_struct_sdna(srna, "bAction");
	RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");

	func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
	RNA_def_function_ui_description(func, "Add a pose marker to the action");
	parm = RNA_def_string(func, "name", "Marker", 0, NULL, "New name for the marker (not unique)");
	RNA_def_property_flag(parm, PROP_REQUIRED);

	parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
	RNA_def_function_ui_description(func, "Remove a timeline marker");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
	
	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "TimelineMarker");
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_LIB_EXCEPTION);
	RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get",
	                               "rna_Action_active_pose_marker_set", NULL, NULL);
	RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this action");
	
	prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "active_marker");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get",
	                           "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range");
	RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker");
}
Example #29
0
static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *parm;
	FunctionRNA *func;

	/* PropertyRNA *prop; */
	
	RNA_def_property_srna(cprop, "AnimDataDrivers");
	srna = RNA_def_struct(brna, "AnimDataDrivers", NULL);
	RNA_def_struct_sdna(srna, "AnimData");
	RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves");
	
	func = RNA_def_function(srna, "from_existing", "rna_Driver_from_existing");
	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
	RNA_def_function_ui_description(func, "Add a new driver given an existing one");
	RNA_def_pointer(func, "src_driver", "FCurve", "", "Existing Driver F-Curve to use as template for a new one");
	/* return type */
	parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve");
	RNA_def_function_return(func, parm);
}
Example #30
0
static void rna_def_gpencil_stroke_points_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;

	FunctionRNA *func;
	/* PropertyRNA *parm; */

	RNA_def_property_srna(cprop, "GPencilStrokePoints");
	srna = RNA_def_struct(brna, "GPencilStrokePoints", NULL);
	RNA_def_struct_sdna(srna, "bGPDstroke");
	RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Points", "Collection of grease pencil stroke points");

	func = RNA_def_function(srna, "add", "rna_GPencil_stroke_point_add");
	RNA_def_function_ui_description(func, "Add a new grease pencil stroke point");
	RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the stroke", 0, INT_MAX);

	func = RNA_def_function(srna, "pop", "rna_GPencil_stroke_point_pop");
	RNA_def_function_ui_description(func, "Remove a grease pencil stroke point");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	RNA_def_int(func, "index", -1, INT_MIN, INT_MAX, "Index", "point index", INT_MIN, INT_MAX);
}