Revision: 14400
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14400
Author: blendix
Date: 2008-04-12 20:44:03 +0200 (Sat, 12 Apr 2008)
Log Message:
-----------
Fix for bug #8463: object texture mapping for duplis was changed to
act as if the object was in its original position, instead of being
different for all instances. However, this is desired behavior in
some cases and so breaks compatibility. Now it only does the new
behavior when enabling the "From Original" option.
Modified Paths:
--------------
trunk/blender/source/blender/makesdna/DNA_texture_types.h
trunk/blender/source/blender/render/intern/source/texture.c
trunk/blender/source/blender/src/buttons_shading.c
Modified: trunk/blender/source/blender/makesdna/DNA_texture_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_texture_types.h 2008-04-12
18:15:10 UTC (rev 14399)
+++ trunk/blender/source/blender/makesdna/DNA_texture_types.h 2008-04-12
18:44:03 UTC (rev 14400)
@@ -353,6 +353,7 @@
#define MTEX_ALPHAMIX 8
#define MTEX_VIEWSPACE 16
#define MTEX_DUPLI_MAPTO 32
+#define MTEX_OB_DUPLI_ORIG 64
/* blendtype */
#define MTEX_BLEND 0
Modified: trunk/blender/source/blender/render/intern/source/texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/texture.c 2008-04-12
18:15:10 UTC (rev 14399)
+++ trunk/blender/source/blender/render/intern/source/texture.c 2008-04-12
18:44:03 UTC (rev 14400)
@@ -1468,8 +1468,9 @@
dx= dxt;
dy= dyt;
VECCOPY(tempvec, shi->co);
- if(shi->obi && shi->obi->duplitexmat)
-
MTC_Mat4MulVecfl(shi->obi->duplitexmat, tempvec);
+ if(mtex->texflag & MTEX_OB_DUPLI_ORIG)
+ if(shi->obi &&
shi->obi->duplitexmat)
+
MTC_Mat4MulVecfl(shi->obi->duplitexmat, tempvec);
MTC_Mat4MulVecfl(ob->imat, tempvec);
if(shi->osatex) {
VECCOPY(dxt, shi->dxco);
Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c 2008-04-12 18:15:10 UTC
(rev 14399)
+++ trunk/blender/source/blender/src/buttons_shading.c 2008-04-12 18:44:03 UTC
(rev 14400)
@@ -3429,7 +3429,10 @@
if(ELEM(mtex->texco, TEXCO_UV, TEXCO_ORCO))
uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From
Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "If object is
duplicated by vertices, faces or particles, inherit texture coordinate from
parent object");
+ else if(mtex->texco == TEXCO_OBJECT)
+ uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From
Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "If object is
duplicated, use object coordinates as if the object was in its original
position");
+
/* COORDS */
uiBlockBeginAlign(block);
uiDefButC(block, ROW, B_MATPRV, "Flat", 630,115,48,19,
&(mtex->mapping), 5.0, (float)MTEX_FLAT, 0, 0, "Maps X and Y coordinates
directly");
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs