2009-06-18 19:48:55 +00:00
|
|
|
/**
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
#include "RNA_types.h"
|
2009-09-22 17:50:29 +00:00
|
|
|
#include "RNA_enum_types.h"
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
|
|
#include "BKE_main.h"
|
|
|
|
#include "BKE_mesh.h"
|
2009-12-02 15:37:07 +00:00
|
|
|
#include "BKE_armature.h"
|
2009-06-18 19:48:55 +00:00
|
|
|
#include "BKE_library.h"
|
2009-06-20 16:32:52 +00:00
|
|
|
#include "BKE_object.h"
|
2009-07-02 20:46:35 +00:00
|
|
|
#include "BKE_material.h"
|
2009-07-03 17:44:20 +00:00
|
|
|
#include "BKE_image.h"
|
2009-08-13 11:14:06 +00:00
|
|
|
#include "BKE_texture.h"
|
2010-01-09 23:44:01 +00:00
|
|
|
#include "BKE_scene.h"
|
2010-01-11 00:41:31 +00:00
|
|
|
#include "BKE_text.h"
|
2010-01-11 23:40:01 +00:00
|
|
|
#include "BKE_action.h"
|
|
|
|
#include "BKE_group.h"
|
2009-08-13 11:14:06 +00:00
|
|
|
|
2009-12-02 15:37:07 +00:00
|
|
|
#include "DNA_armature_types.h"
|
2010-01-09 23:44:01 +00:00
|
|
|
#include "DNA_camera_types.h"
|
2009-08-13 11:14:06 +00:00
|
|
|
#include "DNA_lamp_types.h"
|
2009-12-02 15:37:07 +00:00
|
|
|
#include "DNA_material_types.h"
|
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
#include "DNA_object_types.h"
|
2010-01-11 00:41:31 +00:00
|
|
|
#include "DNA_text_types.h"
|
2010-01-17 20:06:34 +00:00
|
|
|
#include "DNA_texture_types.h"
|
2010-01-11 23:40:01 +00:00
|
|
|
#include "DNA_group_types.h"
|
2010-01-11 00:41:31 +00:00
|
|
|
|
|
|
|
#include "ED_screen.h"
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Tex *rna_Main_add_texture(Main *bmain, char *name)
|
2009-06-18 19:48:55 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
return add_texture(name);
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Image *rna_Main_add_image(Main *bmain, char *filename)
|
2009-06-18 19:48:55 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
return BKE_add_image_file(filename, 0);
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Camera *rna_Main_cameras_new(Main *bmain, char* name)
|
2009-12-02 15:37:07 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
return add_camera(name);
|
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *camera)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(camera) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->camera, camera);
|
2009-12-02 15:37:07 +00:00
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d.", camera->id.name+2, ID_REAL_USERS(camera));
|
2009-12-02 15:37:07 +00:00
|
|
|
|
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Scene *rna_Main_scenes_new(Main *bmain, char* name)
|
2009-12-02 15:37:07 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
return add_scene(name);
|
2009-08-13 11:14:06 +00:00
|
|
|
}
|
2010-01-11 00:41:31 +00:00
|
|
|
void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struct Scene *scene)
|
2009-08-13 11:14:06 +00:00
|
|
|
{
|
2010-01-11 00:41:31 +00:00
|
|
|
/* dont call free_libblock(...) directly */
|
|
|
|
Scene *newscene;
|
|
|
|
|
|
|
|
if(scene->id.prev)
|
|
|
|
newscene= scene->id.prev;
|
|
|
|
else if(scene->id.next)
|
|
|
|
newscene= scene->id.next;
|
|
|
|
else {
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed.", scene->id.name+2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ED_screen_set_scene(C, newscene);
|
|
|
|
|
|
|
|
unlink_scene(bmain, scene, newscene);
|
2009-08-13 11:14:06 +00:00
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Object *rna_Main_objects_new(Main *bmain, char* name, int type)
|
2009-06-20 16:32:52 +00:00
|
|
|
{
|
2009-06-24 19:23:34 +00:00
|
|
|
Object *ob= add_only_object(type, name);
|
|
|
|
ob->id.us--;
|
|
|
|
return ob;
|
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *object)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
NOTE: the following example shows when this function should _not_ be called
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
ob = bpy.data.add_object()
|
|
|
|
scene.add_object(ob)
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
# ob is freed here
|
|
|
|
scene.remove_object(ob)
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
# don't do this since ob is already freed!
|
|
|
|
bpy.data.remove_object(ob)
|
|
|
|
*/
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(object) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->object, object);
|
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d.", object->id.name+2, ID_REAL_USERS(object));
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
struct Material *rna_Main_materials_new(Main *bmain, char* name)
|
2009-06-24 19:23:34 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
return add_material(name);
|
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material *material)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(material) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->mat, material);
|
2009-06-24 19:23:34 +00:00
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d.", material->id.name+2, ID_REAL_USERS(material));
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
/* XXX python now has invalid pointer? */
|
2009-06-20 16:32:52 +00:00
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Mesh *rna_Main_meshes_new(Main *bmain, char* name)
|
2009-07-02 20:46:35 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
Mesh *me= add_mesh(name);
|
|
|
|
me->id.us--;
|
|
|
|
return me;
|
2009-07-02 20:46:35 +00:00
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(mesh) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->mesh, mesh);
|
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d.", mesh->id.name+2, ID_REAL_USERS(mesh));
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
Lamp *rna_Main_lamps_new(Main *bmain, char* name)
|
2009-07-02 20:46:35 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
Lamp *lamp= add_lamp(name);
|
|
|
|
lamp->id.us--;
|
|
|
|
return lamp;
|
2009-07-02 20:46:35 +00:00
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(lamp) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->lamp, lamp);
|
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d.", lamp->id.name+2, ID_REAL_USERS(lamp));
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-17 20:06:34 +00:00
|
|
|
Tex *rna_Main_textures_new(Main *bmain, char* name)
|
|
|
|
{
|
|
|
|
Tex *tex= add_texture(name);
|
|
|
|
tex->id.us--;
|
|
|
|
return tex;
|
|
|
|
}
|
|
|
|
void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
|
|
|
|
{
|
|
|
|
if(ID_REAL_USERS(tex) == 0)
|
|
|
|
free_libblock(&bmain->tex, tex);
|
|
|
|
else
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
|
|
|
|
}
|
|
|
|
|
2010-01-11 23:40:01 +00:00
|
|
|
Group *rna_Main_groups_new(Main *bmain, char* name)
|
|
|
|
{
|
|
|
|
return add_group(name);
|
|
|
|
}
|
|
|
|
void rna_Main_groups_remove(Main *bmain, ReportList *reports, Group *group)
|
|
|
|
{
|
|
|
|
unlink_group(group);
|
|
|
|
group->id.us= 0;
|
|
|
|
free_libblock(&bmain->group, group);
|
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
Text *rna_Main_texts_new(Main *bmain, char* name)
|
|
|
|
{
|
|
|
|
return add_empty_text(name);
|
|
|
|
}
|
|
|
|
void rna_Main_texts_remove(Main *bmain, ReportList *reports, Text *text)
|
|
|
|
{
|
|
|
|
unlink_text(bmain, text);
|
|
|
|
free_libblock(&bmain->text, text);
|
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
|
|
|
Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* path)
|
|
|
|
{
|
|
|
|
Text *txt= add_text(path, bmain->name);
|
|
|
|
if(txt==NULL)
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "Couldn't load text from path \"%s\".", path);
|
|
|
|
|
|
|
|
return txt;
|
|
|
|
}
|
|
|
|
|
2010-01-10 15:20:22 +00:00
|
|
|
bArmature *rna_Main_armatures_new(Main *bmain, char* name)
|
2009-07-03 17:44:20 +00:00
|
|
|
{
|
2010-01-09 23:44:01 +00:00
|
|
|
bArmature *arm= add_armature(name);
|
|
|
|
arm->id.us--;
|
|
|
|
return arm;
|
|
|
|
}
|
2010-01-10 15:20:22 +00:00
|
|
|
void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(arm) == 0)
|
2010-01-09 23:44:01 +00:00
|
|
|
free_libblock(&bmain->armature, arm);
|
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d.", arm->id.name+2, ID_REAL_USERS(arm));
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
/* XXX python now has invalid pointer? */
|
2009-07-03 17:44:20 +00:00
|
|
|
}
|
|
|
|
|
2010-01-11 23:40:01 +00:00
|
|
|
bAction *rna_Main_actions_new(Main *bmain, char* name)
|
|
|
|
{
|
|
|
|
bAction *act= add_empty_action(name);
|
|
|
|
act->id.us--;
|
|
|
|
act->id.flag &= ~LIB_FAKEUSER;
|
|
|
|
return act;
|
|
|
|
}
|
|
|
|
void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
|
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
if(ID_REAL_USERS(act) == 0)
|
2010-01-11 23:40:01 +00:00
|
|
|
free_libblock(&bmain->action, act);
|
|
|
|
else
|
2010-01-17 20:06:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d.", act->id.name+2, ID_REAL_USERS(act));
|
2010-01-11 23:40:01 +00:00
|
|
|
|
|
|
|
/* XXX python now has invalid pointer? */
|
|
|
|
}
|
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
void RNA_api_main(StructRNA *srna)
|
|
|
|
{
|
|
|
|
FunctionRNA *func;
|
2009-06-20 16:32:52 +00:00
|
|
|
PropertyRNA *parm;
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new image.");
|
|
|
|
parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainCameras");
|
|
|
|
srna= RNA_def_struct(brna, "MainCameras", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_cameras_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new camera to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock.");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_cameras_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainScenes");
|
|
|
|
srna= RNA_def_struct(brna, "MainScenes", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
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");
|
2010-01-11 00:41:31 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
RNA_def_function_ui_description(func, "Remove a scene from the current blendfile.");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainObjects");
|
|
|
|
srna= RNA_def_struct(brna, "MainObjects", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_objects_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new object to the main database");
|
2009-06-20 16:32:52 +00:00
|
|
|
parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
parm= RNA_def_enum(func, "type", object_type_items, 0, "", "Type of Object.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock.");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_objects_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2009-06-24 19:23:34 +00:00
|
|
|
parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a object from the current blendfile.");
|
|
|
|
}
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainMaterials");
|
|
|
|
srna= RNA_def_struct(brna, "MainMaterials", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_materials_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new material to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock.");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock.");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_materials_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a material from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainMeshes");
|
|
|
|
srna= RNA_def_struct(brna, "MainMeshes", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_meshes_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new mesh to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
|
2009-12-02 15:37:07 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock.");
|
2009-12-02 15:37:07 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
|
2009-12-02 15:37:07 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainLamps");
|
|
|
|
srna= RNA_def_struct(brna, "MainLamps", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps");
|
2009-12-02 15:37:07 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_lamps_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new lamp to the main database");
|
2009-08-13 11:14:06 +00:00
|
|
|
parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock.");
|
2009-08-13 11:14:06 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
}
|
|
|
|
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_vfonts(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainTextures");
|
|
|
|
srna= RNA_def_struct(brna, "MainTextures", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2010-01-17 20:06:34 +00:00
|
|
|
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);
|
|
|
|
/* 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);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2010-01-11 23:40:01 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2010-01-11 23:40:01 +00:00
|
|
|
RNA_def_property_srna(cprop, "MainGroups");
|
|
|
|
srna= RNA_def_struct(brna, "MainGroups", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups");
|
2010-01-11 23:40:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_groups_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new group to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock.");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_groups_remove");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2010-01-11 00:41:31 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainTexts");
|
|
|
|
srna= RNA_def_struct(brna, "MainTexts", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
|
2010-01-11 00:41:31 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_texts_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new text to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
|
|
|
|
RNA_def_function_return(func, parm);
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_texts_remove");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
RNA_def_function_ui_description(func, "Remove a text from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
|
|
|
|
/* load func */
|
|
|
|
func= RNA_def_function(srna, "load", "rna_Main_texts_load");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
|
|
|
|
parm= RNA_def_string(func, "path", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
|
|
|
|
RNA_def_function_return(func, parm);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainArmatures");
|
|
|
|
srna= RNA_def_struct(brna, "MainArmatures", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_armatures_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new armature to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock.");
|
2009-07-03 17:44:20 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock.");
|
2009-07-03 17:44:20 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
}
|
|
|
|
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
2010-01-11 23:40:01 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MainActions");
|
|
|
|
srna= RNA_def_struct(brna, "MainActions", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
|
2010-01-11 23:40:01 +00:00
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Main_actions_new");
|
|
|
|
RNA_def_function_ui_description(func, "Add a new action to the main database");
|
|
|
|
parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
/* return type */
|
|
|
|
parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock.");
|
|
|
|
RNA_def_function_return(func, parm);
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2010-01-11 23:40:01 +00:00
|
|
|
func= RNA_def_function(srna, "remove", "rna_Main_actions_remove");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
RNA_def_function_ui_description(func, "Remove a action from the current blendfile.");
|
|
|
|
parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove.");
|
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|