Fix #33135: cycles object info random number not working anymore.

This commit is contained in:
Brecht Van Lommel 2012-11-10 14:50:34 +00:00
parent 5ebe7d6a13
commit 5ddc5fbfb3
2 changed files with 7 additions and 2 deletions

@ -267,10 +267,15 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
object->motion.post = tfm;
object->use_motion = false;
/* random number */
object->random_id = hash_string(object->name.c_str());
if(persistent_id)
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);
/* visibility flags for both parent */
object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL;

@ -422,7 +422,7 @@ class USERPREF_PT_system(Panel):
col.separator()
col.separator()
if hasattr(system, "compute_device"):
if hasattr(system, "compute_device_type"):
col.label(text="Compute Device:")
col.row().prop(system, "compute_device_type", expand=True)
sub = col.row()