Fix #33135: cycles object info random number not working anymore.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 10 Nov 2012 14:50:34 +0000 (14:50 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 10 Nov 2012 14:50:34 +0000 (14:50 +0000)
intern/cycles/blender/blender_object.cpp
release/scripts/startup/bl_ui/space_userpref.py

index 67255d9f7072bd91759cc19d07033f023e53b765..e8fa5c0ff3d33fe0472914f281e0f173e2e5a467 100644 (file)
@@ -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;
index 3c426ade54b7ba6101f54092c88a2a65c81e9e1d..de55eaba77528eb468eb94d88172f2d62c6f36f3 100644 (file)
@@ -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()