diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-23 16:14:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-23 16:14:07 +0400 |
commit | f1b9d395e34d66cabbdb28a4432ea9554a77a299 (patch) | |
tree | 485230c10aee4c26291b104340f6fe04b5da3b24 /source | |
parent | c249d2b95a45aa9e53760ce25cd19dd0f243d6ff (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')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 20 |
4 files changed, 25 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 410509f92cc..d9b22553c7a 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -241,7 +241,6 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) { Scene *scene= oglrender->scene; - int view_context = (oglrender->v3d != NULL); if(oglrender->mh) { if(BKE_imtype_is_movie(scene->r.imtype)) diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 005efdb9bc4..0dcfc773d19 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -227,6 +227,7 @@ void RNA_api_main(struct StructRNA *srna); void RNA_api_material(StructRNA *srna); void RNA_api_mesh(struct StructRNA *srna); void RNA_api_object(struct StructRNA *srna); +void RNA_api_object_base(struct StructRNA *srna); void RNA_api_pose_channel(struct StructRNA *srna); void RNA_api_scene(struct StructRNA *srna); void RNA_api_scene_render(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 93a133bf380..12c4bb79e37 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2050,7 +2050,7 @@ static void rna_def_dupli_object(BlenderRNA *brna) /* TODO: DupliObject has more properties that can be wrapped */ } -static void rna_def_base(BlenderRNA *brna) +static void rna_def_object_base(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -2081,13 +2081,15 @@ static void rna_def_base(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_WAS_SEL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "User Selected", "Object base user selection state, used to restore user selection after transformations"); + + RNA_api_object_base(srna); } void RNA_def_object(BlenderRNA *brna) { rna_def_object(brna); rna_def_object_game_settings(brna); - rna_def_base(brna); + rna_def_object_base(brna); rna_def_vertex_group(brna); rna_def_material_slot(brna); rna_def_dupli_object(brna); 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 |