| 
									
										
										
										
											2011-02-23 10:52:22 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  |  * ***** 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 | 
					
						
							| 
									
										
										
										
											2012-03-18 09:27:36 +00:00
										 |  |  |  * of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2009 Blender Foundation. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-03-18 09:27:36 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  |  * Contributor(s): Blender Foundation | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-27 20:20:01 +00:00
										 |  |  | /** \file blender/makesrna/intern/rna_main_api.c
 | 
					
						
							|  |  |  |  *  \ingroup RNA | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #include <stdlib.h>
 | 
					
						
							|  |  |  | #include <stdio.h>
 | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | #include <errno.h>
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | #include "DNA_ID.h"
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | #include "DNA_modifier_types.h"
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-10 13:44:18 +00:00
										 |  |  | #include "BLI_utildefines.h"
 | 
					
						
							| 
									
										
										
										
											2013-03-04 18:36:37 +00:00
										 |  |  | #include "BLI_path_util.h"
 | 
					
						
							| 
									
										
										
										
											2012-09-03 22:04:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #include "RNA_define.h"
 | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | #include "RNA_access.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-22 17:50:29 +00:00
										 |  |  | #include "RNA_enum_types.h"
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-03 22:04:14 +00:00
										 |  |  | #include "rna_internal.h"
 | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #ifdef RNA_RUNTIME
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "BKE_main.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-05 13:00:39 +00:00
										 |  |  | #include "BKE_camera.h"
 | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | #include "BKE_curve.h"
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | #include "BKE_DerivedMesh.h"
 | 
					
						
							|  |  |  | #include "BKE_displist.h"
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #include "BKE_mesh.h"
 | 
					
						
							| 
									
										
										
										
											2009-12-02 15:37:07 +00:00
										 |  |  | #include "BKE_armature.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-05 13:11:49 +00:00
										 |  |  | #include "BKE_lamp.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"
 | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | #include "BKE_brush.h"
 | 
					
						
							|  |  |  | #include "BKE_lattice.h"
 | 
					
						
							|  |  |  | #include "BKE_mball.h"
 | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | #include "BKE_world.h"
 | 
					
						
							|  |  |  | #include "BKE_particle.h"
 | 
					
						
							|  |  |  | #include "BKE_font.h"
 | 
					
						
							|  |  |  | #include "BKE_node.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | #include "BKE_depsgraph.h"
 | 
					
						
							| 
									
										
										
										
											2011-08-04 07:12:03 +00:00
										 |  |  | #include "BKE_speaker.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | #include "BKE_movieclip.h"
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | #include "BKE_mask.h"
 | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | #include "BKE_gpencil.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"
 | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | #include "DNA_curve_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"
 | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | #include "DNA_speaker_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-05-14 21:16:37 +00:00
										 |  |  | #include "DNA_brush_types.h"
 | 
					
						
							|  |  |  | #include "DNA_lattice_types.h"
 | 
					
						
							|  |  |  | #include "DNA_meta_types.h"
 | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | #include "DNA_world_types.h"
 | 
					
						
							|  |  |  | #include "DNA_particle_types.h"
 | 
					
						
							|  |  |  | #include "DNA_vfont_types.h"
 | 
					
						
							|  |  |  | #include "DNA_node_types.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | #include "DNA_movieclip_types.h"
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | #include "DNA_mask_types.h"
 | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | #include "DNA_gpencil_types.h"
 | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "ED_screen.h"
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-16 07:53:10 +00:00
										 |  |  | #include "BLF_translation.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Camera *rna_Main_cameras_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2009-12-02 15:37:07 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	ID *id = BKE_camera_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(id); | 
					
						
							| 
									
										
										
										
											2010-09-11 06:27:38 +00:00
										 |  |  | 	return (Camera *)id; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_cameras_remove(Main *bmain, ReportList *reports, PointerRNA *camera_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Camera *camera = camera_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(camera) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->camera, camera); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(camera_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Camera '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            camera->id.name + 2, ID_REAL_USERS(camera)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-12-02 15:37:07 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-13 01:17:22 +00:00
										 |  |  | static Scene *rna_Main_scenes_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2009-12-02 15:37:07 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-12-13 01:17:22 +00:00
										 |  |  | 	return BKE_scene_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2009-08-13 11:14:06 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | static void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr) | 
					
						
							| 
									
										
										
										
											2009-08-13 11:14:06 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-05-05 14:03:12 +00:00
										 |  |  | 	/* don't call BKE_libblock_free(...) directly */ | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Scene *scene = scene_ptr->data; | 
					
						
							|  |  |  | 	Scene *scene_new; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if ((scene_new = scene->id.prev) || | 
					
						
							|  |  |  | 	    (scene_new = scene->id.next)) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		bScreen *sc = CTX_wm_screen(C); | 
					
						
							|  |  |  | 		if (sc->scene == scene) { | 
					
						
							|  |  |  | 			ED_screen_set_scene(C, sc, scene_new); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		BKE_scene_unlink(bmain, scene, scene_new); | 
					
						
							|  |  |  | 		RNA_POINTER_INVALIDATE(scene_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Scene '%s' is the last, cannot be removed", scene->id.name + 2); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-08-13 11:14:06 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data) | 
					
						
							| 
									
										
										
										
											2009-06-20 16:32:52 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 	Object *ob; | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	int type = OB_EMPTY; | 
					
						
							|  |  |  | 	if (data) { | 
					
						
							| 
									
										
										
										
											2012-08-12 14:57:19 +00:00
										 |  |  | 		/* keep in sync with OB_DATA_SUPPORT_ID() macro */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 		switch (GS(data->name)) { | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 			case ID_ME: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_MESH; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case ID_CU: | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 				type = BKE_curve_type_get((Curve *)data); | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case ID_MB: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_MBALL; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case ID_LA: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_LAMP; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 			case ID_SPK: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_SPEAKER; | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 				break; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 			case ID_CA: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_CAMERA; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case ID_LT: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_LATTICE; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case ID_AR: | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				type = OB_ARMATURE; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			default: | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				const char *idname; | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 				if (RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0) | 
					
						
							|  |  |  | 					idname = "UNKNOWN"; | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 				BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname); | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 				return NULL; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 		id_us_plus(data); | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	ob = BKE_object_add_only_object(bmain, type, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&ob->id); | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	ob->data = data; | 
					
						
							| 
									
										
										
										
											2010-03-18 06:03:41 +00:00
										 |  |  | 	test_object_materials(ob->data); | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-06-24 19:23:34 +00:00
										 |  |  | 	return ob; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_objects_remove(Main *bmain, ReportList *reports, PointerRNA *object_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Object *object = object_ptr->data; | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	if (ID_REAL_USERS(object) <= 0) { | 
					
						
							| 
									
										
										
										
											2012-05-05 14:03:12 +00:00
										 |  |  | 		BKE_object_unlink(object); /* needed or ID pointers to this are not cleared */ | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->object, object); | 
					
						
							| 
									
										
										
										
											2012-11-02 09:41:26 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(object_ptr); | 
					
						
							| 
									
										
										
										
											2010-09-20 03:09:24 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Object '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            object->id.name + 2, ID_REAL_USERS(object)); | 
					
						
							| 
									
										
										
										
											2010-09-20 03:09:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2009-06-24 19:23:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Material *rna_Main_materials_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2012-05-17 23:21:11 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	ID *id = (ID *)BKE_material_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(id); | 
					
						
							| 
									
										
										
										
											2010-09-11 06:27:38 +00:00
										 |  |  | 	return (Material *)id; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_materials_remove(Main *bmain, ReportList *reports, PointerRNA *material_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Material *material = material_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(material) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->mat, material); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(material_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Material '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            material->id.name + 2, ID_REAL_USERS(material)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-06-20 16:32:52 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type) | 
					
						
							| 
									
										
										
										
											2012-05-17 23:21:11 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	bNodeTree *tree = ntreeAddTree(bmain, name, type, NODE_GROUP); | 
					
						
							| 
									
										
										
										
											2010-12-03 03:44:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&tree->id); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	return tree; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, PointerRNA *tree_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	bNodeTree *tree = tree_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(tree) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->nodetree, tree); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(tree_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Node tree '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            tree->id.name + 2, ID_REAL_USERS(tree)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Mesh *rna_Main_meshes_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Mesh *me = BKE_mesh_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&me->id); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	return me; | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* copied from Mesh_getFromObject and adapted to RNA interface */ | 
					
						
							|  |  |  | /* settings: 1 - preview, 2 - render */ | 
					
						
							| 
									
										
										
										
											2013-02-10 13:44:18 +00:00
										 |  |  | Mesh *rna_Main_meshes_new_from_object( | 
					
						
							|  |  |  |         Main *bmain, ReportList *reports, Scene *sce, | 
					
						
							|  |  |  |         Object *ob, int apply_modifiers, int settings, int calc_tessface) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Mesh *tmpmesh; | 
					
						
							|  |  |  | 	Curve *tmpcu = NULL, *copycu; | 
					
						
							|  |  |  | 	Object *tmpobj = NULL; | 
					
						
							|  |  |  | 	int render = settings == eModifierMode_Render, i; | 
					
						
							|  |  |  | 	int cage = !apply_modifiers; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* perform the mesh extraction based on type */ | 
					
						
							|  |  |  | 	switch (ob->type) { | 
					
						
							|  |  |  | 		case OB_FONT: | 
					
						
							|  |  |  | 		case OB_CURVE: | 
					
						
							|  |  |  | 		case OB_SURF: | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			ListBase dispbase = {NULL, NULL}; | 
					
						
							|  |  |  | 			DerivedMesh *derivedFinal = NULL; | 
					
						
							|  |  |  | 			int uv_from_orco; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* copies object and modifiers (but not the data) */ | 
					
						
							|  |  |  | 			tmpobj = BKE_object_copy_ex(bmain, ob, TRUE); | 
					
						
							|  |  |  | 			tmpcu = (Curve *)tmpobj->data; | 
					
						
							|  |  |  | 			tmpcu->id.us--; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* if getting the original caged mesh, delete object modifiers */ | 
					
						
							|  |  |  | 			if (cage) | 
					
						
							|  |  |  | 				BKE_object_free_modifiers(tmpobj); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* copies the data */ | 
					
						
							|  |  |  | 			copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* temporarily set edit so we get updates from edit mode, but
 | 
					
						
							|  |  |  | 			 * also because for text datablocks copying it while in edit | 
					
						
							|  |  |  | 			 * mode gives invalid data structures */ | 
					
						
							|  |  |  | 			copycu->editfont = tmpcu->editfont; | 
					
						
							|  |  |  | 			copycu->editnurb = tmpcu->editnurb; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* get updated display list, and convert to a mesh */ | 
					
						
							|  |  |  | 			BKE_displist_make_curveTypes_forRender(sce, tmpobj, &dispbase, &derivedFinal, FALSE); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			copycu->editfont = NULL; | 
					
						
							|  |  |  | 			copycu->editnurb = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			tmpobj->derivedFinal = derivedFinal; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* convert object type to mesh */ | 
					
						
							|  |  |  | 			uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0; | 
					
						
							|  |  |  | 			BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			tmpmesh = tmpobj->data; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			BKE_displist_free(&dispbase); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */ | 
					
						
							|  |  |  | 			if (tmpobj->type != OB_MESH) { | 
					
						
							|  |  |  | 				BKE_libblock_free_us(&(G.main->object), tmpobj); | 
					
						
							|  |  |  | 				BKE_report(reports, RPT_ERROR, "Cannot convert curve to mesh (does the curve have any segments?)"); | 
					
						
							|  |  |  | 				return NULL; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			BKE_libblock_free_us(&bmain->object, tmpobj); | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case OB_MBALL: | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			/* metaballs don't have modifiers, so just convert to mesh */ | 
					
						
							|  |  |  | 			Object *basis_ob = BKE_mball_basis_find(sce, ob); | 
					
						
							|  |  |  | 			/* todo, re-generatre for render-res */ | 
					
						
							|  |  |  | 			/* metaball_polygonize(scene, ob) */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (ob != basis_ob) | 
					
						
							|  |  |  | 				return NULL;  /* only do basis metaball */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			tmpmesh = BKE_mesh_add(bmain, "Mesh"); | 
					
						
							|  |  |  | 			/* BKE_mesh_add gives us a user count we don't need */ | 
					
						
							|  |  |  | 			tmpmesh->id.us--; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (render) { | 
					
						
							|  |  |  | 				ListBase disp = {NULL, NULL}; | 
					
						
							|  |  |  | 				BKE_displist_make_mball_forRender(sce, ob, &disp); | 
					
						
							|  |  |  | 				BKE_mesh_from_metaball(&disp, tmpmesh); | 
					
						
							|  |  |  | 				BKE_displist_free(&disp); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			else | 
					
						
							|  |  |  | 				BKE_mesh_from_metaball(&ob->disp, tmpmesh); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		case OB_MESH: | 
					
						
							|  |  |  | 			/* copies object and modifiers (but not the data) */ | 
					
						
							|  |  |  | 			if (cage) { | 
					
						
							|  |  |  | 				/* copies the data */ | 
					
						
							|  |  |  | 				tmpmesh = BKE_mesh_copy_ex(bmain, ob->data); | 
					
						
							|  |  |  | 				/* if not getting the original caged mesh, get final derived mesh */ | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							|  |  |  | 				/* Make a dummy mesh, saves copying */ | 
					
						
							|  |  |  | 				DerivedMesh *dm; | 
					
						
							|  |  |  | 				/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */ | 
					
						
							|  |  |  | 				CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
 | 
					
						
							|  |  |  | 			                                         * for example, needs CD_MASK_MDEFORMVERT */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				/* Write the display mesh into the dummy mesh */ | 
					
						
							|  |  |  | 				if (render) | 
					
						
							|  |  |  | 					dm = mesh_create_derived_render(sce, ob, mask); | 
					
						
							|  |  |  | 				else | 
					
						
							|  |  |  | 					dm = mesh_create_derived_view(sce, ob, mask); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				tmpmesh = BKE_mesh_add(bmain, "Mesh"); | 
					
						
							|  |  |  | 				DM_to_mesh(dm, tmpmesh, ob); | 
					
						
							|  |  |  | 				dm->release(dm); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* BKE_mesh_add/copy gives us a user count we don't need */ | 
					
						
							|  |  |  | 			tmpmesh->id.us--; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		default: | 
					
						
							|  |  |  | 			BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); | 
					
						
							|  |  |  | 			return NULL; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Copy materials to new mesh */ | 
					
						
							|  |  |  | 	switch (ob->type) { | 
					
						
							|  |  |  | 		case OB_SURF: | 
					
						
							|  |  |  | 		case OB_FONT: | 
					
						
							|  |  |  | 		case OB_CURVE: | 
					
						
							|  |  |  | 			tmpmesh->totcol = tmpcu->totcol; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* free old material list (if it exists) and adjust user counts */ | 
					
						
							|  |  |  | 			if (tmpcu->mat) { | 
					
						
							|  |  |  | 				for (i = tmpcu->totcol; i-- > 0; ) { | 
					
						
							|  |  |  | 					/* are we an object material or data based? */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					if (tmpmesh->mat[i]) { | 
					
						
							|  |  |  | 						tmpmesh->mat[i]->id.us++; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2013-01-24 16:20:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | #if 0
 | 
					
						
							|  |  |  | 		/* Crashes when assigning the new material, not sure why */ | 
					
						
							|  |  |  | 		case OB_MBALL: | 
					
						
							|  |  |  | 			tmpmb = (MetaBall *)ob->data; | 
					
						
							|  |  |  | 			tmpmesh->totcol = tmpmb->totcol; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			/* free old material list (if it exists) and adjust user counts */ | 
					
						
							|  |  |  | 			if (tmpmb->mat) { | 
					
						
							|  |  |  | 				for (i = tmpmb->totcol; i-- > 0; ) { | 
					
						
							|  |  |  | 					tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */ | 
					
						
							|  |  |  | 					if (tmpmesh->mat[i]) { | 
					
						
							|  |  |  | 						tmpmb->mat[i]->id.us++; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case OB_MESH: | 
					
						
							|  |  |  | 			if (!cage) { | 
					
						
							|  |  |  | 				Mesh *origmesh = ob->data; | 
					
						
							|  |  |  | 				tmpmesh->flag = origmesh->flag; | 
					
						
							|  |  |  | 				tmpmesh->mat = MEM_dupallocN(origmesh->mat); | 
					
						
							|  |  |  | 				tmpmesh->totcol = origmesh->totcol; | 
					
						
							|  |  |  | 				tmpmesh->smoothresh = origmesh->smoothresh; | 
					
						
							|  |  |  | 				if (origmesh->mat) { | 
					
						
							|  |  |  | 					for (i = origmesh->totcol; i-- > 0; ) { | 
					
						
							|  |  |  | 						/* are we an object material or data based? */ | 
					
						
							|  |  |  | 						tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						if (tmpmesh->mat[i]) { | 
					
						
							|  |  |  | 							tmpmesh->mat[i]->id.us++; | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 	} /* end copy materials */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-10 13:44:18 +00:00
										 |  |  | 	if (calc_tessface) { | 
					
						
							|  |  |  | 		/* cycles and exporters rely on this still */ | 
					
						
							|  |  |  | 		BKE_mesh_tessface_ensure(tmpmesh); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* make sure materials get updated in objects */ | 
					
						
							|  |  |  | 	test_object_materials(&tmpmesh->id); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return tmpmesh; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void rna_Main_meshes_remove(Main *bmain, ReportList *reports, PointerRNA *mesh_ptr) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Mesh *mesh = mesh_ptr->data; | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	if (ID_REAL_USERS(mesh) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->mesh, mesh); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(mesh_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Mesh '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            mesh->id.name + 2, ID_REAL_USERS(mesh)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type) | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Lamp *lamp = BKE_lamp_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	lamp->type = type; | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&lamp->id); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	return lamp; | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_lamps_remove(Main *bmain, ReportList *reports, PointerRNA *lamp_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Lamp *lamp = lamp_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(lamp) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->lamp, lamp); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(lamp_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Lamp '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            lamp->id.name + 2, ID_REAL_USERS(lamp)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Image *rna_Main_images_new(Main *bmain, const char *name, int width, int height, int alpha, int float_buffer) | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	float color[4] = {0.0, 0.0, 0.0, 1.0}; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Image *image = BKE_image_add_generated(bmain, width, height, name, alpha ? 32 : 24, float_buffer, 0, color); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&image->id); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	return image; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Image *rna_Main_images_load(Main *bmain, ReportList *reports, const char *filepath) | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 	Image *ima; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	errno = 0; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	ima = BKE_image_load(bmain, filepath); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	if (!ima) { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath, | 
					
						
							|  |  |  | 		            errno ? strerror(errno) : TIP_("unsupported image format")); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return ima; | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_images_remove(Main *bmain, ReportList *reports, PointerRNA *image_ptr) | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 15:56:42 +00:00
										 |  |  | 	Image *image = image_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(image) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->image, image); | 
					
						
							| 
									
										
										
										
											2012-11-01 15:56:42 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(image_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Image '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            image->id.name + 2, ID_REAL_USERS(image)); | 
					
						
							| 
									
										
										
										
											2012-11-01 15:56:42 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Lattice *rna_Main_lattices_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Lattice *lt = BKE_lattice_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(<->id); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	return lt; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_lattices_remove(Main *bmain, ReportList *reports, PointerRNA *lt_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Lattice *lt = lt_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(lt) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->latt, lt); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(lt_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Lattice '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            lt->id.name + 2, ID_REAL_USERS(lt)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type) | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Curve *cu = BKE_curve_add(bmain, name, type); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&cu->id); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	return cu; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_curves_remove(Main *bmain, ReportList *reports, PointerRNA *cu_ptr) | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Curve *cu = cu_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(cu) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->curve, cu); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(cu_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Curve '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            cu->id.name + 2, ID_REAL_USERS(cu)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	MetaBall *mb = BKE_mball_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&mb->id); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	return mb; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, PointerRNA *mb_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	MetaBall *mb = mb_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(mb) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->mball, mb); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(mb_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Metaball '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            mb->id.name + 2, ID_REAL_USERS(mb)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-22 14:07:55 +00:00
										 |  |  | static VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 	VFont *font; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	errno = 0; | 
					
						
							| 
									
										
										
										
											2012-05-05 14:52:04 +00:00
										 |  |  | 	font = BKE_vfont_load(bmain, filepath); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	if (!font) | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath, | 
					
						
							|  |  |  | 		            errno ? strerror(errno) : TIP_("unsupported font format")); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return font; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | static void rna_Main_fonts_remove(Main *bmain, ReportList *reports, PointerRNA *vfont_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	VFont *vfont = vfont_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(vfont) <= 0) { | 
					
						
							| 
									
										
										
										
											2012-05-05 14:03:12 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->vfont, vfont); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(vfont_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Font '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            vfont->id.name + 2, ID_REAL_USERS(vfont)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type) | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Tex *tex = add_texture(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-08-26 14:44:25 +00:00
										 |  |  | 	tex_set_type(tex, type); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&tex->id); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	return tex; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_textures_remove(Main *bmain, ReportList *reports, PointerRNA *tex_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Tex *tex = tex_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(tex) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->tex, tex); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(tex_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Texture '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            tex->id.name + 2, ID_REAL_USERS(tex)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Brush *rna_Main_brushes_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Brush *brush = BKE_brush_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&brush->id); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	return brush; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_brushes_remove(Main *bmain, ReportList *reports, PointerRNA *brush_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Brush *brush = brush_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(brush) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->brush, brush); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(brush_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Brush '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            brush->id.name + 2, ID_REAL_USERS(brush)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static World *rna_Main_worlds_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	World *world = add_world(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&world->id); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	return world; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_worlds_remove(Main *bmain, ReportList *reports, PointerRNA *world_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Group *world = world_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(world) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->world, world); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(world_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "World '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            world->id.name + 2, ID_REAL_USERS(world)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Group *rna_Main_groups_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	return add_group(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_groups_remove(Main *bmain, PointerRNA *group_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Group *group = group_ptr->data; | 
					
						
							| 
									
										
										
										
											2012-05-05 14:03:12 +00:00
										 |  |  | 	BKE_group_unlink(group); | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	BKE_libblock_free(&bmain->group, group); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_POINTER_INVALIDATE(group_ptr); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Speaker *rna_Main_speakers_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	Speaker *speaker = BKE_speaker_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	id_us_min(&speaker->id); | 
					
						
							|  |  |  | 	return speaker; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_speakers_remove(Main *bmain, ReportList *reports, PointerRNA *speaker_ptr) | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Speaker *speaker = speaker_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(speaker) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->speaker, speaker); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(speaker_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Speaker '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            speaker->id.name + 2, ID_REAL_USERS(speaker)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Text *rna_Main_texts_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	return BKE_text_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_texts_remove(Main *bmain, PointerRNA *text_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Text *text = text_ptr->data; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	BKE_text_unlink(bmain, text); | 
					
						
							|  |  |  | 	BKE_libblock_free(&bmain->text, text); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_POINTER_INVALIDATE(text_ptr); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-22 14:07:55 +00:00
										 |  |  | static Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath) | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 	Text *txt; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	errno = 0; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	txt = BKE_text_load(bmain, filepath, bmain->name); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	if (!txt) | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath, | 
					
						
							|  |  |  | 		            errno ? strerror(errno) : TIP_("unable to load text")); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return txt; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static bArmature *rna_Main_armatures_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2009-07-03 17:44:20 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	bArmature *arm = BKE_armature_add(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&arm->id); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	return arm; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_armatures_remove(Main *bmain, ReportList *reports, PointerRNA *arm_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	bArmature *arm = arm_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(arm) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->armature, arm); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(arm_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Armature '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            arm->id.name + 2, ID_REAL_USERS(arm)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-07-03 17:44:20 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static bAction *rna_Main_actions_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	bAction *act = add_empty_action(bmain, name); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&act->id); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	act->id.flag &= ~LIB_FAKEUSER; | 
					
						
							|  |  |  | 	return act; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_actions_remove(Main *bmain, ReportList *reports, PointerRNA *act_ptr) | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	bAction *act = act_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(act) <= 0) { | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->action, act); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(act_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Action '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            act->id.name + 2, ID_REAL_USERS(act)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-22 14:07:55 +00:00
										 |  |  | static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	ParticleSettings *part = psys_new_settings(name, bmain); | 
					
						
							| 
									
										
										
										
											2010-12-19 16:34:58 +00:00
										 |  |  | 	id_us_min(&part->id); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	return part; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | static void rna_Main_particles_remove(Main *bmain, ReportList *reports, PointerRNA *part_ptr) | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	ParticleSettings *part = part_ptr->data; | 
					
						
							|  |  |  | 	if (ID_REAL_USERS(part) <= 0) { | 
					
						
							| 
									
										
										
										
											2012-05-05 14:03:12 +00:00
										 |  |  | 		BKE_libblock_free(&bmain->particle, part); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(part_ptr); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Particle settings '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		            part->id.name + 2, ID_REAL_USERS(part)); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static MovieClip *rna_Main_movieclip_load(Main *bmain, ReportList *reports, const char *filepath) | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	MovieClip *clip; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	errno = 0; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	clip = BKE_movieclip_file_add(bmain, filepath); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	if (!clip) | 
					
						
							| 
									
										
										
										
											2012-10-20 10:28:34 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath, | 
					
						
							|  |  |  | 		            errno ? strerror(errno) : TIP_("unable to load movie clip")); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return clip; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_movieclips_remove(Main *bmain, PointerRNA *clip_ptr) | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	MovieClip *clip = clip_ptr->data; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	BKE_movieclip_unlink(bmain, clip); | 
					
						
							|  |  |  | 	BKE_libblock_free(&bmain->movieclip, clip); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_POINTER_INVALIDATE(clip_ptr); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static Mask *rna_Main_mask_new(Main *bmain, const char *name) | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	Mask *mask; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	mask = BKE_mask_new(bmain, "Mask"); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return mask; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | static void rna_Main_masks_remove(Main *bmain, PointerRNA *mask_ptr) | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	Mask *mask = mask_ptr->data; | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	BKE_mask_free(bmain, mask); | 
					
						
							|  |  |  | 	BKE_libblock_free(&bmain->mask, mask); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_POINTER_INVALIDATE(mask_ptr); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | static void rna_Main_grease_pencil_remove(Main *bmain, ReportList *reports, PointerRNA *gpd_ptr) | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	bGPdata *gpd = gpd_ptr->data; | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | 	if (ID_REAL_USERS(gpd) <= 0) { | 
					
						
							|  |  |  | 		BKE_gpencil_free(gpd); | 
					
						
							|  |  |  | 		BKE_libblock_free(&bmain->gpencil, gpd); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 		RNA_POINTER_INVALIDATE(gpd_ptr); | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							| 
									
										
										
										
											2012-10-26 17:32:50 +00:00
										 |  |  | 		BKE_reportf(reports, RPT_ERROR, "Grease pencil '%s' must have zero users to be removed, found %d", | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | 		            gpd->id.name + 2, ID_REAL_USERS(gpd)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | /* tag functions, all the same */ | 
					
						
							| 
									
										
										
										
											2012-09-22 14:07:55 +00:00
										 |  |  | static void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); } | 
					
						
							|  |  |  | static void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); } | 
					
						
							|  |  |  | static void rna_Main_objects_tag(Main *bmain, int value) { tag_main_lb(&bmain->object, value); } | 
					
						
							|  |  |  | static void rna_Main_materials_tag(Main *bmain, int value) { tag_main_lb(&bmain->mat, value); } | 
					
						
							|  |  |  | static void rna_Main_node_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->nodetree, value); } | 
					
						
							|  |  |  | static void rna_Main_meshes_tag(Main *bmain, int value) { tag_main_lb(&bmain->mesh, value); } | 
					
						
							|  |  |  | static void rna_Main_lamps_tag(Main *bmain, int value) { tag_main_lb(&bmain->lamp, value); } | 
					
						
							|  |  |  | static void rna_Main_libraries_tag(Main *bmain, int value) { tag_main_lb(&bmain->library, value); } | 
					
						
							|  |  |  | static void rna_Main_screens_tag(Main *bmain, int value) { tag_main_lb(&bmain->screen, value); } | 
					
						
							|  |  |  | static void rna_Main_window_managers_tag(Main *bmain, int value) { tag_main_lb(&bmain->wm, value); } | 
					
						
							|  |  |  | static void rna_Main_images_tag(Main *bmain, int value) { tag_main_lb(&bmain->image, value); } | 
					
						
							|  |  |  | static void rna_Main_lattices_tag(Main *bmain, int value) { tag_main_lb(&bmain->latt, value); } | 
					
						
							|  |  |  | static void rna_Main_curves_tag(Main *bmain, int value) { tag_main_lb(&bmain->curve, value); } | 
					
						
							|  |  |  | static void rna_Main_metaballs_tag(Main *bmain, int value) { tag_main_lb(&bmain->mball, value); } | 
					
						
							|  |  |  | static void rna_Main_fonts_tag(Main *bmain, int value) { tag_main_lb(&bmain->vfont, value); } | 
					
						
							|  |  |  | static void rna_Main_textures_tag(Main *bmain, int value) { tag_main_lb(&bmain->tex, value); } | 
					
						
							|  |  |  | static void rna_Main_brushes_tag(Main *bmain, int value) { tag_main_lb(&bmain->brush, value); } | 
					
						
							|  |  |  | static void rna_Main_worlds_tag(Main *bmain, int value) { tag_main_lb(&bmain->world, value); } | 
					
						
							|  |  |  | static void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, value); } | 
					
						
							| 
									
										
										
										
											2012-09-23 23:44:10 +00:00
										 |  |  | // static void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); }
 | 
					
						
							|  |  |  | // static void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); }
 | 
					
						
							| 
									
										
										
										
											2012-09-22 14:07:55 +00:00
										 |  |  | static void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); } | 
					
						
							|  |  |  | static void rna_Main_speakers_tag(Main *bmain, int value) { tag_main_lb(&bmain->speaker, value); } | 
					
						
							|  |  |  | static void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); } | 
					
						
							|  |  |  | static void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); } | 
					
						
							|  |  |  | static void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); } | 
					
						
							|  |  |  | static void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain->particle, value); } | 
					
						
							|  |  |  | static void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); } | 
					
						
							|  |  |  | static void rna_Main_movieclips_tag(Main *bmain, int value) { tag_main_lb(&bmain->movieclip, value); } | 
					
						
							|  |  |  | static void rna_Main_masks_tag(Main *bmain, int value) { tag_main_lb(&bmain->mask, value); } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); } | 
					
						
							|  |  |  | static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); } | 
					
						
							|  |  |  | static int rna_Main_objects_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_OB); } | 
					
						
							|  |  |  | static int rna_Main_materials_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MA); } | 
					
						
							|  |  |  | static int rna_Main_node_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_NT); } | 
					
						
							|  |  |  | static int rna_Main_meshes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_ME); } | 
					
						
							|  |  |  | static int rna_Main_lamps_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LA); } | 
					
						
							|  |  |  | static int rna_Main_libraries_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LI); } | 
					
						
							|  |  |  | static int rna_Main_screens_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCR); } | 
					
						
							|  |  |  | static int rna_Main_window_managers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WM); } | 
					
						
							|  |  |  | static int rna_Main_images_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_IM); } | 
					
						
							|  |  |  | static int rna_Main_lattices_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LT); } | 
					
						
							|  |  |  | static int rna_Main_curves_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CU); } | 
					
						
							|  |  |  | static int rna_Main_metaballs_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MB); } | 
					
						
							|  |  |  | static int rna_Main_fonts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_VF); } | 
					
						
							|  |  |  | static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TE); } | 
					
						
							|  |  |  | static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR); } | 
					
						
							|  |  |  | static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO); } | 
					
						
							|  |  |  | static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR); } | 
					
						
							|  |  |  | static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT); } | 
					
						
							|  |  |  | static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK); } | 
					
						
							|  |  |  | static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO); } | 
					
						
							|  |  |  | static int rna_Main_armatures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AR); } | 
					
						
							|  |  |  | static int rna_Main_actions_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AC); } | 
					
						
							|  |  |  | static int rna_Main_particles_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_PA); } | 
					
						
							|  |  |  | static int rna_Main_gpencil_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GD); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #else
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RNA_api_main(StructRNA *srna) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-04-22 11:54:53 +00:00
										 |  |  | #if 0
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | 	FunctionRNA *func; | 
					
						
							| 
									
										
										
										
											2009-06-20 16:32:52 +00:00
										 |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	/* maybe we want to add functions in 'bpy.data' still?
 | 
					
						
							|  |  |  | 	 * for now they are all in collections bpy.data.images.new(...) */ | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 	func = RNA_def_function(srna, "add_image", "rna_Main_add_image"); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new image"); | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 	parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "image", "Image", "", "New image"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2012-09-20 01:02:39 +00:00
										 |  |  | #else
 | 
					
						
							|  |  |  | 	(void)srna; | 
					
						
							| 
									
										
										
										
											2012-04-22 11:54:53 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataCameras"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataCameras", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_cameras_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new camera to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a camera from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_cameras_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataScenes"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataScenes", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_scenes_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new scene to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove"); | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a scene from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-23 07:26:08 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_scenes_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataObjects"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataObjects", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_objects_new"); | 
					
						
							| 
									
										
										
										
											2010-02-22 00:07:46 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new object to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2009-06-20 16:32:52 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_objects_remove"); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a object from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2010-01-10 15:20:22 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_objects_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_objects_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataMaterials"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataMaterials", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-09-30 08:10:53 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_materials_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new material to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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 */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +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); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a material from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_materials_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_materials_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							| 
									
										
										
										
											2010-12-03 03:44:39 +00:00
										 |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 03:44:39 +00:00
										 |  |  | 	static EnumPropertyItem node_nodetree_items[] = { | 
					
						
							| 
									
										
										
										
											2012-05-12 11:01:29 +00:00
										 |  |  | 		{0, "SHADER",       0,    "Shader",       ""}, | 
					
						
							|  |  |  | 		{1, "COMPOSITE",    0,    "Composite",    ""}, | 
					
						
							|  |  |  | 		{2, "TEXTURE",      0,    "Texture",      ""}, | 
					
						
							|  |  |  | 		{0, NULL, 0, NULL, NULL} | 
					
						
							|  |  |  | 	}; | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataNodeTrees"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_nodetree_new"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new node tree to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-12-03 03:44:39 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_nodetree_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_node_groups_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	static EnumPropertyItem mesh_type_items[] = { | 
					
						
							|  |  |  | 		{eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"}, | 
					
						
							|  |  |  | 		{eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"}, | 
					
						
							|  |  |  | 		{0, NULL, 0, NULL, NULL} | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataMeshes"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataMeshes", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_meshes_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new mesh to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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 */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock"); | 
					
						
							| 
									
										
										
										
											2009-12-02 15:37:07 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object"); | 
					
						
							|  |  |  | 	RNA_def_function_ui_description(func, "Add a new mesh created from object with modifiers applied"); | 
					
						
							|  |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							|  |  |  | 	parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); | 
					
						
							|  |  |  | 	parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from"); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2013-02-10 13:44:18 +00:00
										 |  |  | 	RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces"); | 
					
						
							| 
									
										
										
										
											2013-02-05 12:46:15 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "mesh", "Mesh", "", | 
					
						
							|  |  |  | 	                       "Mesh created from object, remove it if it is only used for export"); | 
					
						
							|  |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +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); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_meshes_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataLamps"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataLamps", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_lamps_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new lamp to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2009-08-13 11:14:06 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add"); | 
					
						
							| 
									
										
										
										
											2011-01-11 02:30:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock"); | 
					
						
							| 
									
										
										
										
											2009-08-13 11:14:06 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +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); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_lamps_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataLibraries"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataLibraries", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries"); | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_libraries_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2009-07-02 20:46:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataScreens"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataScreens", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_screens_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_screens_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataWindowManagers"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_window_managers_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataImages"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataImages", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Images", "Collection of images"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_images_new"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new image to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-10-11 23:46:12 +00:00
										 |  |  | 	parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX); | 
					
						
							| 
									
										
										
										
											2011-01-10 03:58:07 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-10-11 23:46:12 +00:00
										 |  |  | 	parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX); | 
					
						
							| 
									
										
										
										
											2011-01-10 03:58:07 +00:00
										 |  |  | 	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"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "load", "rna_Main_images_load"); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Load a new image into the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_images_remove"); | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove an image from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 15:56:42 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_images_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_images_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
											
												merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
											
										 
											2010-03-20 16:41:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataLattices"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataLattices", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_lattices_new"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new lattice to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_lattices_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_lattices_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataCurves"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataCurves", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_curves_new"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new curve to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_curves_remove"); | 
					
						
							| 
									
										
										
										
											2010-03-23 14:58:36 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a curve from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_curves_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_curves_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataMetaBalls"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2012-03-02 21:14:37 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_metaballs_new"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new metaball to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_metaballs_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_metaballs_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-05-08 07:25:26 +00:00
										 |  |  | void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataFonts"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataFonts", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "load", "rna_Main_fonts_load"); | 
					
						
							| 
									
										
										
										
											2010-07-03 17:47:06 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Load a new font into the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_fonts_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a font from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_fonts_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataTextures"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataTextures", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_textures_new"); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new texture to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add"); | 
					
						
							| 
									
										
										
										
											2010-08-25 01:20:50 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_textures_remove"); | 
					
						
							| 
									
										
										
										
											2010-01-17 20:06:34 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a texture from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_textures_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_textures_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataBrushes"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataBrushes", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_brushes_new"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new brush to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_brushes_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-14 21:16:37 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a brush from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_brushes_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataWorlds"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataWorlds", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_worlds_new"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new world to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "World", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "world", "World", "", "New world datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_worlds_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a world from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "world", "World", "", "World to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_worlds_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataGroups"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataGroups", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_groups_new"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new group to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "group", "Group", "", "New group datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_groups_remove"); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a group from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "group", "Group", "", "Group to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_groups_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_groups_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	RNA_def_property_srna(cprop, "BlendDataSpeakers"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							|  |  |  | 	RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_speakers_new"); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new speaker to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock"); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_speakers_remove"); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_speakers_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2011-08-01 11:44:20 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataTexts"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataTexts", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_texts_new"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new text to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_texts_remove"); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a text from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* load func */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "load", "rna_Main_texts_load"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	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"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 00:41:31 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_texts_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_texts_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataSounds"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataSounds", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	/* TODO, 'load' */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_sounds_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataArmatures"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataArmatures", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_armatures_new"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new armature to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	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 */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock"); | 
					
						
							| 
									
										
										
										
											2009-07-03 17:44:20 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +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); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a armature from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_armatures_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataActions"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataActions", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_actions_new"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new action to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "action", "Action", "", "New action datablock"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_actions_remove"); | 
					
						
							| 
									
										
										
										
											2010-01-11 23:40:01 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a action from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_actions_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_actions_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataParticles"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataParticles", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings"); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_particles_new"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_particles_remove"); | 
					
						
							| 
									
										
										
										
											2010-05-15 13:30:14 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							| 
									
										
										
										
											2011-09-19 13:23:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_particles_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_particles_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							| 
									
										
										
										
											2010-01-09 23:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 03:15:55 +00:00
										 |  |  | 	RNA_def_property_srna(cprop, "BlendDataGreasePencils"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL); | 
					
						
							| 
									
										
										
										
											2011-03-13 13:01:02 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_gpencil_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-01-05 05:33:27 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | 	func = RNA_def_function(srna, "new", "gpencil_data_addnew"); | 
					
						
							|  |  |  | 	RNA_def_function_flag(func, FUNC_NO_SELF); | 
					
						
							|  |  |  | 	parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the datablock"); | 
					
						
							|  |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							|  |  |  | 	parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "New grease pencil datablock"); | 
					
						
							|  |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_grease_pencil_remove"); | 
					
						
							|  |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							|  |  |  | 	RNA_def_function_ui_description(func, "Remove a grease pencil instance from the current blendfile"); | 
					
						
							|  |  |  | 	parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2012-10-07 20:07:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | 
					
						
							| 
									
										
										
										
											2011-11-02 20:56:52 +00:00
										 |  |  | 	RNA_def_property_clear_flag(prop, PROP_EDITABLE); | 
					
						
							|  |  |  | 	RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL); | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	RNA_def_property_srna(cprop, "BlendDataMovieClips"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							|  |  |  | 	RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_movieclips_remove"); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile."); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* load func */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	func = RNA_def_function(srna, "load", "rna_Main_movieclip_load"); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_function_flag(func, FUNC_USE_REPORTS); | 
					
						
							|  |  |  | 	RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file"); | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock"); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 	/* return type */ | 
					
						
							| 
									
										
										
										
											2012-03-05 23:30:41 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock"); | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	StructRNA *srna; | 
					
						
							|  |  |  | 	FunctionRNA *func; | 
					
						
							|  |  |  | 	PropertyRNA *parm; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	RNA_def_property_srna(cprop, "BlendDataMasks"); | 
					
						
							| 
									
										
										
										
											2012-06-27 18:29:47 +00:00
										 |  |  | 	srna = RNA_def_struct(brna, "BlendDataMasks", NULL); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 	RNA_def_struct_sdna(srna, "Main"); | 
					
						
							|  |  |  | 	RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-27 18:29:47 +00:00
										 |  |  | 	func = RNA_def_function(srna, "tag", "rna_Main_masks_tag"); | 
					
						
							|  |  |  | 	parm = RNA_def_boolean(func, "value", 0, "Value", ""); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* new func */ | 
					
						
							|  |  |  | 	func = RNA_def_function(srna, "new", "rna_Main_mask_new"); | 
					
						
							|  |  |  | 	RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database"); | 
					
						
							| 
									
										
										
										
											2012-11-01 09:54:00 +00:00
										 |  |  | 	RNA_def_string_file_path(func, "name", "", MAX_ID_NAME - 2, "Mask", "Name of new mask datablock"); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 	/* return type */ | 
					
						
							|  |  |  | 	parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask datablock"); | 
					
						
							|  |  |  | 	RNA_def_function_return(func, parm); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* remove func */ | 
					
						
							| 
									
										
										
										
											2012-06-27 18:29:47 +00:00
										 |  |  | 	func = RNA_def_function(srna, "remove", "rna_Main_masks_remove"); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | 	RNA_def_function_ui_description(func, "Remove a masks from the current blendfile."); | 
					
						
							| 
									
										
										
										
											2012-06-27 18:29:47 +00:00
										 |  |  | 	parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove"); | 
					
						
							| 
									
										
										
										
											2012-11-01 17:16:24 +00:00
										 |  |  | 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | 
					
						
							|  |  |  | 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | 
					
						
							| 
									
										
										
										
											2012-06-04 16:42:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-18 19:48:55 +00:00
										 |  |  | #endif
 |