diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-08 17:07:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-08 17:07:16 +0400 |
commit | 28ee0f92184af8ba6f44d08eda23ce5eb3815697 (patch) | |
tree | 6aada8d509c7470bd3bff6e52ba32e1fd54ef2ee /source/blender/editors/space_image | |
parent | 19df3147f6920a2856bccb6e4601d57288119999 (diff) |
Texturing: texture and 3d view draw type changes, these should only have any
effect for a render engine using new shading nodes. In short:
* No longer uses images assigned to faces in the uv layer, rather the active
image texture node is what is edited/painted/drawn.
* Textured draw type now shows the active image texture node, with solid
lighting.
* Material draw mode shows GLSL shader of a simplified material node tree,
using solid lighting.
* Textures for modifiers, brushes, etc, are now available from a dropdown in
the texture tab in the properties editor. These do not use new shading nodes
yet.
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/TextureWorkflow
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 3b9876329ec..c29553a9c87 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -47,7 +47,10 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_image.h" +#include "BKE_global.h" +#include "BKE_main.h" #include "BKE_mesh.h" +#include "BKE_scene.h" #include "BKE_screen.h" #include "IMB_imbuf_types.h" @@ -81,7 +84,7 @@ Image *ED_space_image(SpaceImage *sima) /* called to assign images to UV faces */ void ED_space_image_set(bContext *C, SpaceImage *sima, Scene *scene, Object *obedit, Image *ima) { - ED_uvedit_assign_image(scene, obedit, ima, sima->image); + ED_uvedit_assign_image(CTX_data_main(C), scene, obedit, ima, sima->image); /* change the space ima after because uvedit_face_visible uses the space ima * to check if the face is displayed in UV-localview */ @@ -572,6 +575,7 @@ static void image_dropboxes(void) static void image_refresh(const bContext *C, ScrArea *UNUSED(sa)) { + Scene *scene = CTX_data_scene(C); SpaceImage *sima= CTX_wm_space_image(C); Object *obedit= CTX_data_edit_object(C); Image *ima; @@ -586,19 +590,31 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa)) else if(obedit && obedit->type == OB_MESH) { Mesh *me= (Mesh*)obedit->data; EditMesh *em= BKE_mesh_get_editmesh(me); - MTFace *tf; - - if(em && EM_texFaceCheck(em)) { - sima->image= NULL; - - tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */ + int sloppy= 1; /* partially selected face is ok */ + + if(scene_use_new_shading_nodes(scene)) { + /* new shading system, get image from material */ + EditFace *efa= EM_get_actFace(em, sloppy); + + if(efa) + ED_object_get_active_image(obedit, efa->mat_nr, &sima->image, NULL, NULL); + } + else { + /* old shading system, we set texface */ + MTFace *tf; - if(tf) { - /* don't need to check for pin here, see above */ - sima->image= tf->tpage; + if(em && EM_texFaceCheck(em)) { + sima->image= NULL; + + tf = EM_get_active_mtface(em, NULL, NULL, sloppy); - if(sima->flag & SI_EDITTILE); - else sima->curtile= tf->tile; + if(tf) { + /* don't need to check for pin here, see above */ + sima->image= tf->tpage; + + if(sima->flag & SI_EDITTILE); + else sima->curtile= tf->tile; + } } } |