Cycles does not respect the automatically calculated texture space for objects of type TEXT #53559

Closed
opened 2017-12-15 05:01:59 +01:00 by Germano Cavalcante · 4 comments

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)
auto_texture_bug.blend1

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

**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) [auto_texture_bug.blend1](https://archive.blender.org/developer/F1410109/auto_texture_bug.blend1) To check it out as it should be. Just see how this works on Eevee.
Author
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Sergey Sharybin was assigned by Germano Cavalcante 2017-12-15 05:02:25 +01:00

Have a proposed fix P577: Fix for #53559

diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 0d01fe77453..a3fa754c725 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1396,6 +1396,17 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
 	me->totcol = cu->totcol;
 	me->mat = cu->mat;
 
+	/* Copy evaluated texture space from curve to mesh.
+	 *
+	 * Note that we disable auto texture space feature since that will cause
+	 * texture space to evaluate differently for curve and mesh, since curve
+	 * uses CV to calculate bounding box, and mesh uses what is coming from
+	 * tessellated curve.
+	 */
+	me->texflag = cu->texflag & ~CU_AUTOSPACE;
+	copy_v3_v3(me->loc, cu->loc);
+	copy_v3_v3(me->size, cu->size);
+	copy_v3_v3(me->rot, cu->rot);
 	BKE_mesh_texspace_calc(me);
 
 	cu->mat = NULL;
@@ -2420,6 +2431,11 @@ Mesh *BKE_mesh_new_from_object(
 			/* copies the data */
 			copycu = tmpobj->data = BKE_curve_copy(bmain, (Curve *) ob->data);
 
+			/* make sure texture space is calculated for a copy of curve,
+			 * it will be used for the final result.
+			 */
+			BKE_curve_texspace_calc(copycu);
+
 			/* temporarily set edit so we get updates from edit mode, but
 			 * also because for text datablocks copying it while in edit
 			 * mode gives invalid data structures */
@@ -2450,8 +2466,6 @@ Mesh *BKE_mesh_new_from_object(
 				return NULL;
 			}
 
-			BKE_mesh_texspace_copy_from_object(tmpmesh, ob);
-
 			BKE_libblock_free_us(bmain, tmpobj);
 
 			/* XXX The curve to mesh conversion is convoluted... But essentially, BKE_mesh_from_nurbs_displist()

, but extra eyes are welcome.

Have a proposed fix [P577: Fix for #53559](https://archive.blender.org/developer/P577.txt) ``` diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 0d01fe77453..a3fa754c725 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1396,6 +1396,17 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use me->totcol = cu->totcol; me->mat = cu->mat; + /* Copy evaluated texture space from curve to mesh. + * + * Note that we disable auto texture space feature since that will cause + * texture space to evaluate differently for curve and mesh, since curve + * uses CV to calculate bounding box, and mesh uses what is coming from + * tessellated curve. + */ + me->texflag = cu->texflag & ~CU_AUTOSPACE; + copy_v3_v3(me->loc, cu->loc); + copy_v3_v3(me->size, cu->size); + copy_v3_v3(me->rot, cu->rot); BKE_mesh_texspace_calc(me); cu->mat = NULL; @@ -2420,6 +2431,11 @@ Mesh *BKE_mesh_new_from_object( /* copies the data */ copycu = tmpobj->data = BKE_curve_copy(bmain, (Curve *) ob->data); + /* make sure texture space is calculated for a copy of curve, + * it will be used for the final result. + */ + BKE_curve_texspace_calc(copycu); + /* temporarily set edit so we get updates from edit mode, but * also because for text datablocks copying it while in edit * mode gives invalid data structures */ @@ -2450,8 +2466,6 @@ Mesh *BKE_mesh_new_from_object( return NULL; } - BKE_mesh_texspace_copy_from_object(tmpmesh, ob); - BKE_libblock_free_us(bmain, tmpobj); /* XXX The curve to mesh conversion is convoluted... But essentially, BKE_mesh_from_nurbs_displist() ``` , but extra eyes are welcome.

This issue was referenced by c34f3c777f

This issue was referenced by c34f3c777f9a783033a098734c25716d1def3f09

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53559
No description provided.