[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57851] trunk/blender/source/blender/ render/intern/source/convertblender.c: Fix #35412: blender internal " from dupli" texture coordinates not working with
Brecht Van Lommel
brechtvanlommel at pandora.be
Fri Jun 28 18:06:56 CEST 2013
Revision: 57851
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57851
Author: blendix
Date: 2013-06-28 16:06:55 +0000 (Fri, 28 Jun 2013)
Log Message:
-----------
Fix #35412: blender internal "from dupli" texture coordinates not working with
particles in linked groups.
Modified Paths:
--------------
trunk/blender/source/blender/render/intern/source/convertblender.c
Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/convertblender.c 2013-06-28 15:12:54 UTC (rev 57850)
+++ trunk/blender/source/blender/render/intern/source/convertblender.c 2013-06-28 16:06:55 UTC (rev 57851)
@@ -4563,7 +4563,7 @@
return OB_TYPE_SUPPORT_MATERIAL(type);
}
-static void find_dupli_instances(Render *re, ObjectRen *obr)
+static void find_dupli_instances(Render *re, ObjectRen *obr, DupliObject *dob)
{
ObjectInstanceRen *obi;
float imat[4][4], obmat[4][4], obimat[4][4], nmat[3][3];
@@ -4588,6 +4588,12 @@
invert_m3_m3(obi->nmat, nmat);
transpose_m3(obi->nmat);
+ if (dob) {
+ copy_v3_v3(obi->dupliorco, dob->orco);
+ obi->dupliuv[0]= dob->uv[0];
+ obi->dupliuv[1]= dob->uv[1];
+ }
+
if (!first) {
re->totvert += obr->totvert;
re->totvlak += obr->totvlak;
@@ -4600,7 +4606,7 @@
}
}
-static void assign_dupligroup_dupli(Render *re, ObjectInstanceRen *obi, ObjectRen *obr)
+static void assign_dupligroup_dupli(Render *re, ObjectInstanceRen *obi, ObjectRen *obr, DupliObject *dob)
{
float imat[4][4], obmat[4][4], obimat[4][4], nmat[3][3];
@@ -4618,6 +4624,12 @@
invert_m3_m3(obi->nmat, nmat);
transpose_m3(obi->nmat);
+ if (dob) {
+ copy_v3_v3(obi->dupliorco, dob->orco);
+ obi->dupliuv[0]= dob->uv[0];
+ obi->dupliuv[1]= dob->uv[1];
+ }
+
re->totvert += obr->totvert;
re->totvlak += obr->totvlak;
re->tothalo += obr->tothalo;
@@ -4682,6 +4694,12 @@
invert_m4_m4(imat, dob->mat);
mul_serie_m4(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0);
}
+
+ if (dob) {
+ copy_v3_v3(obi->dupliorco, dob->orco);
+ obi->dupliuv[0]= dob->uv[0];
+ obi->dupliuv[1]= dob->uv[1];
+ }
}
static void init_render_object_data(Render *re, ObjectRen *obr, int timeoffset)
@@ -4765,7 +4783,7 @@
if (dob) set_dupli_tex_mat(re, obi, dob);
}
else
- find_dupli_instances(re, obr);
+ find_dupli_instances(re, obr, dob);
for (i=1; i<=ob->totcol; i++) {
Material* ma = give_render_material(re, ob, i);
@@ -4796,7 +4814,7 @@
if (dob) set_dupli_tex_mat(re, obi, dob);
}
else
- find_dupli_instances(re, obr);
+ find_dupli_instances(re, obr, dob);
}
}
}
@@ -5154,9 +5172,9 @@
* created object, and possibly setup instances if this object
* itself was duplicated. for the first case find_dupli_instances
* will be called later. */
- assign_dupligroup_dupli(re, obi, obr);
+ assign_dupligroup_dupli(re, obi, obr, dob);
if (obd->transflag & OB_RENDER_DUPLI)
- find_dupli_instances(re, obr);
+ find_dupli_instances(re, obr, dob);
}
}
@@ -5176,9 +5194,9 @@
obi->dupliuv[1]= dob->uv[1];
}
else {
- assign_dupligroup_dupli(re, obi, obr);
+ assign_dupligroup_dupli(re, obi, obr, dob);
if (obd->transflag & OB_RENDER_DUPLI)
- find_dupli_instances(re, obr);
+ find_dupli_instances(re, obr, dob);
}
}
}
More information about the Bf-blender-cvs
mailing list