From 111e2f5abacc0d93b83de66d1cde8f37e60f1395 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 12 Nov 2016 17:21:21 +0100 Subject: Fix T49904: Cycles standalone missing default generated texture coordinates. --- intern/cycles/app/cycles_xml.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'intern/cycles/app/cycles_xml.cpp') diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index b3be07fce48..29a68bf272e 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -395,7 +395,7 @@ static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node) int shader = 0; bool smooth = state.smooth; - /* read vertices and polygons, RIB style */ + /* read vertices and polygons */ vector P; vector UV; vector verts, nverts; @@ -521,8 +521,12 @@ static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node) sdparams.objecttoworld = state.tfm; } - /* temporary for test compatibility */ - mesh->attributes.remove(ATTR_STD_VERTEX_NORMAL); + /* we don't yet support arbitrary attributes, for now add vertex + * coordinates as generated coordinates if requested */ + if (mesh->need_attribute(state.scene, ATTR_STD_GENERATED)) { + Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED); + memcpy(attr->data_float3(), mesh->verts.data(), sizeof(float3)*mesh->verts.size()); + } } /* Light */ -- cgit v1.2.3