diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-04-18 17:06:01 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-04-18 17:29:42 +0300 |
commit | bc6a75b405c4e0b1e85c9c6ec6646fd2d3f67686 (patch) | |
tree | 1dd28ef80fa66fc0703ead335e2801fa10aa6ec4 /intern | |
parent | b8fd6f94a06c65f6bfe90d9cc45ae1406cd0dc27 (diff) |
Revert "Object Info node support for GLSL mode and the internal render"
This reverts commit 76425feed8644a8fe1c0e52ef3f77b95012ba44e.
** Note **
This was supposed to be a merge, but it was rebased.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 2810ad15b9a..d05699236cc 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -379,16 +379,27 @@ Object *BlenderSync::sync_object(BL::Object& b_parent, } } - /* dupli texture coordinates and random_id */ + /* random number */ + object->random_id = hash_string(object->name.c_str()); + + if(persistent_id) { + for(int i = 0; i < OBJECT_PERSISTENT_ID_SIZE; i++) + object->random_id = hash_int_2d(object->random_id, persistent_id[i]); + } + else + object->random_id = hash_int_2d(object->random_id, 0); + + if(b_parent.ptr.data != b_ob.ptr.data) + object->random_id ^= hash_int(hash_string(b_parent.name().c_str())); + + /* dupli texture coordinates */ if(b_dupli_ob) { object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f); object->dupli_uv = get_float2(b_dupli_ob.uv()); - object->random_id = b_dupli_ob.random_id(); } else { object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f); object->dupli_uv = make_float2(0.0f, 0.0f); - object->random_id = hash_int_2d(hash_string(object->name.c_str()), 0); } object->tag_update(scene); |