Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-03 16:31:05 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-03 16:31:05 +0400
commitb3f21a22548db7e8e77001065b9139c44a8e0c62 (patch)
treef5b4dc68d19ab8ce313a14a667e98c53047c7ba0 /intern/cycles/blender/blender_mesh.cpp
parentbf25f1ea96d01b513907cf3067e8e2dd3c7e41b4 (diff)
Cycles Hair: add Generated texture coordinates for curves, so that procedural
textures now work without having to add a UV map. Also made UV and intercept attributes only export when needed by the shader.
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r--intern/cycles/blender/blender_mesh.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 86f996320cb..1dd7800dfa4 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -328,14 +328,9 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
* is available in the api. */
if(mesh->need_attribute(scene, ATTR_STD_GENERATED)) {
Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED);
- float3 loc = get_float3(b_mesh.texspace_location());
- float3 size = get_float3(b_mesh.texspace_size());
- if(size.x != 0.0f) size.x = 0.5f/size.x;
- if(size.y != 0.0f) size.y = 0.5f/size.y;
- if(size.z != 0.0f) size.z = 0.5f/size.z;
-
- loc = loc*size - make_float3(0.5f, 0.5f, 0.5f);
+ float3 loc, size;
+ mesh_texture_space(b_mesh, loc, size);
float3 *generated = attr->data_float3();
size_t i = 0;