Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-23 16:14:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-23 16:14:07 +0400
commitf1b9d395e34d66cabbdb28a4432ea9554a77a299 (patch)
tree485230c10aee4c26291b104340f6fe04b5da3b24 /source/blender/makesrna/intern/rna_object_api.c
parentc249d2b95a45aa9e53760ce25cd19dd0f243d6ff (diff)
- base_object.layers_from_view(view3d), needed for setting local layers
- module 'add_object_utils', so each script doesnt need its own add object code, dealing with layers, scene, cursor location, editmode etc.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 8efc0bb3e45..7b4cd3bed6a 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -65,6 +65,7 @@
#include "DNA_curve_types.h"
#include "DNA_modifier_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_view3d_types.h"
#include "MEM_guardedalloc.h"
@@ -405,6 +406,13 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
*index= -1;
}
+/* ObjectBase */
+
+void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
+{
+ base->lay= base->object->lay= v3d->lay;
+}
+
#else
void RNA_api_object(StructRNA *srna)
@@ -521,5 +529,17 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_return(func, parm);
}
+
+void RNA_api_object_base(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
+ RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view).");
+ parm= RNA_def_pointer(func, "view", "SpaceView3D", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
#endif