diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-15 22:58:01 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-15 22:58:01 +0400 |
commit | be1efd74d120068a9a650feddf512b50e5e6c2b8 (patch) | |
tree | e1232b3256b84165f9194fe5287bf620cf174c18 /source/blender/editors/space_buttons | |
parent | e63d4d2bea06075ef666d613d1136236bb09ae79 (diff) |
2.5/Sculpt:
* Made sculpt mode local to object.
* This also fixes loading files from 2.4x saved in sculptmode
Touched a lot of things here, let me know if anything breaks
TODO:
* The other paint modes should be converted as well
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 59d6a0ec6be..0be151a11b6 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -304,12 +304,13 @@ static int buttons_context_path_particle(ButsContextPath *path) return 0; } -static int buttons_context_path_brush(ButsContextPath *path) +static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) { Scene *scene; ToolSettings *ts; Brush *br= NULL; PointerRNA *ptr= &path->ptr[path->len-1]; + const Object *obact = CTX_data_active_object(C); /* if we already have a (pinned) brush, we're done */ if(RNA_struct_is_a(ptr->type, &RNA_Brush)) { @@ -320,7 +321,7 @@ static int buttons_context_path_brush(ButsContextPath *path) scene= path->ptr[path->len-1].data; ts= scene->toolsettings; - if(G.f & G_SCULPTMODE) + if(obact && obact->mode & OB_MODE_SCULPT) br= ts->sculpt->brush; else if(G.f & G_VERTEXPAINT) br= ts->vpaint->brush; @@ -341,7 +342,7 @@ static int buttons_context_path_brush(ButsContextPath *path) return 0; } -static int buttons_context_path_texture(ButsContextPath *path) +static int buttons_context_path_texture(const bContext *C, ButsContextPath *path) { Material *ma; Lamp *la; @@ -356,7 +357,7 @@ static int buttons_context_path_texture(ButsContextPath *path) return 1; } /* try brush */ - else if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(path)) { + else if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(C, path)) { br= path->ptr[path->len-1].data; if(br) { @@ -465,7 +466,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma found= buttons_context_path_material(path); break; case BCONTEXT_TEXTURE: - found= buttons_context_path_texture(path); + found= buttons_context_path_texture(C, path); break; case BCONTEXT_BONE: found= buttons_context_path_bone(path); |