diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2009-07-21 00:28:29 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2009-07-21 00:28:29 +0400 |
commit | 9a9d118bbf7786b1c5c412bef651885e33709553 (patch) | |
tree | 55f15ebe16824610b6209e3507e4698ce54c03ac /source/blender/editors/space_buttons | |
parent | 1b7f1bc72dbbf2051eb015d219f2c89d43439cad (diff) |
BGE panels: wip
Logic Panel:
- world settings (moved from world)
... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
... separated stereom into stereoflag and stereomode
- properties
... (didn't touch it)
Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
... a datablock link to the materials of an object + the dynamic physic variables
* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 34 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_header.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 2 |
3 files changed, 35 insertions, 4 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index b7e2a3325cb..9048565b01f 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -360,6 +360,32 @@ static int buttons_context_path_texture(ButsContextPath *path) return 0; } +static int buttons_context_path_game(ButsContextPath *path) +{ + /* XXX temporary context. Using material slot instead of ob->game_data */ + Object *ob; + PointerRNA *ptr= &path->ptr[path->len-1]; + Material *ma; + + /* if we already have a (pinned) material, we're done */ + if(RNA_struct_is_a(ptr->type, &RNA_Material)) { + return 1; + } + /* if we have an object, use the object material slot */ + else if(buttons_context_path_object(path)) { + ob= path->ptr[path->len-1].data; + + if(ob && ob->type && (ob->type<OB_LAMP)) { + ma= give_current_material(ob, ob->actcol); + RNA_id_pointer_create(&ma->id, &path->ptr[path->len]); + path->len++; + return 1; + } + } + + /* no path to a material possible */ + return 0; +} static int buttons_context_path(const bContext *C, ButsContextPath *path, int mainb, int worldtex) { SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C); @@ -404,6 +430,9 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma case BCONTEXT_DATA: found= buttons_context_path_data(path, -1); break; + case BCONTEXT_GAME: + found= buttons_context_path_game(path); + break; case BCONTEXT_PARTICLE: found= buttons_context_path_particle(path); break; @@ -496,8 +525,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r /* here we handle context, getting data from precomputed path */ if(CTX_data_dir(member)) { static const char *dir[] = { - "world", "object", "meshe", "armature", "lattice", "curve", - "meta_ball", "lamp", "camera", "material", "material_slot", + "world", "object", "mesh", "armature", "lattice", "curve", + "meta_ball", "lamp", "camera", "material", "material_slot", "game", "texture", "texture_slot", "bone", "edit_bone", "particle_system", "cloth", "soft_body", "fluid", "collision", NULL}; @@ -736,4 +765,3 @@ void buttons_context_register(ARegionType *art) pt->flag= PNL_NO_HEADER; BLI_addtail(&art->paneltypes, pt); } - diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index ff906b7f539..e569ed324cd 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -187,7 +187,8 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_PARTICLES, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)BCONTEXT_PARTICLE, 0, 0, "Particles"); if(sbuts->pathflag & (1<<BCONTEXT_PHYSICS)) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_PHYSICS, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)BCONTEXT_PHYSICS, 0, 0, "Physics"); - + if(sbuts->pathflag & (1<<BCONTEXT_GAME)) + uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_GAME, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)BCONTEXT_GAME, 0, 0, "Game"); xco+= XIC; uiBlockEndAlign(block); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 4a741f85d85..0c1f735451a 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -172,6 +172,8 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar) ED_region_panels(C, ar, vertical, "modifier"); else if (sbuts->mainb == BCONTEXT_CONSTRAINT) ED_region_panels(C, ar, vertical, "constraint"); + else if (sbuts->mainb == BCONTEXT_GAME) + ED_region_panels(C, ar, vertical, "game"); sbuts->re_align= 0; sbuts->mainbo= sbuts->mainb; |