Page MenuHome

Cycles does not respect the automatically calculated texture space for objects of type TEXT
Closed, ResolvedPublic

Description

Short description of error
The "Auto Texture Space" option in the "Texture Space" panel on the "Object data" tab is used to automatically calculate the texture space coordinates (which can be viewed by checking "Texture Space" in the "Display" panel in the Object properties ).

This option works well for Mesh objects. Adapting the texture space to the object's boundbox whenever it changes.

But with objects of type Text, the "Auto Texture Space" does not work. (For the boundbox can not be calculated through the objetct data.)

However the Cycles makes it seem like work. And the result shown in the preview of the cycles is not consistent with the actual size of the texture space of Text objects.

Exact steps for others to reproduce the error
This file shows the actual size of the texture space (in solid view) and the size that the cycles considered to be the auto texture space (render preview)

To check it out as it should be. Just see how this works on Eevee.

Related Objects

Event Timeline

Sergey Sharybin (sergey) triaged this task as Confirmed, Medium priority.Dec 18 2017, 11:46 AM

Have a proposed fix

1diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
2index 0d01fe77453..a3fa754c725 100644
3--- a/source/blender/blenkernel/intern/mesh.c
4+++ b/source/blender/blenkernel/intern/mesh.c
5@@ -1396,6 +1396,17 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
6 me->totcol = cu->totcol;
7 me->mat = cu->mat;
8
9+ /* Copy evaluated texture space from curve to mesh.
10+ *
11+ * Note that we disable auto texture space feature since that will cause
12+ * texture space to evaluate differently for curve and mesh, since curve
13+ * uses CV to calculate bounding box, and mesh uses what is coming from
14+ * tessellated curve.
15+ */
16+ me->texflag = cu->texflag & ~CU_AUTOSPACE;
17+ copy_v3_v3(me->loc, cu->loc);
18+ copy_v3_v3(me->size, cu->size);
19+ copy_v3_v3(me->rot, cu->rot);
20 BKE_mesh_texspace_calc(me);
21
22 cu->mat = NULL;
23@@ -2420,6 +2431,11 @@ Mesh *BKE_mesh_new_from_object(
24 /* copies the data */
25 copycu = tmpobj->data = BKE_curve_copy(bmain, (Curve *) ob->data);
26
27+ /* make sure texture space is calculated for a copy of curve,
28+ * it will be used for the final result.
29+ */
30+ BKE_curve_texspace_calc(copycu);
31+
32 /* temporarily set edit so we get updates from edit mode, but
33 * also because for text datablocks copying it while in edit
34 * mode gives invalid data structures */
35@@ -2450,8 +2466,6 @@ Mesh *BKE_mesh_new_from_object(
36 return NULL;
37 }
38
39- BKE_mesh_texspace_copy_from_object(tmpmesh, ob);
40-
41 BKE_libblock_free_us(bmain, tmpobj);
42
43 /* XXX The curve to mesh conversion is convoluted... But essentially, BKE_mesh_from_nurbs_displist()
, but extra eyes are welcome.