Cycles: fix multithreading issue introduced in previous commit
The issue is that the shaders are stolen from the original Geometry by the temporary Geometry used to accumulate data, but the main thread still needs them for syncing the attributes. So make a copy of the shader array to preserve the data on the original Geometry.
This commit is contained in:
@@ -819,8 +819,12 @@ void BlenderSync::sync_hair(Hair *hair, BL::Object &b_ob, bool motion, int motio
|
||||
|
||||
void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Hair *hair)
|
||||
{
|
||||
/* make a copy of the shaders as the caller in the main thread still need them for syncing the
|
||||
* attributes */
|
||||
array<Node *> used_shaders = hair->get_used_shaders();
|
||||
|
||||
Hair new_hair;
|
||||
new_hair.set_used_shaders(hair->get_used_shaders());
|
||||
new_hair.set_used_shaders(used_shaders);
|
||||
|
||||
if (view_layer.use_hair) {
|
||||
if (b_ob.type() == BL::Object::type_HAIR) {
|
||||
|
||||
Reference in New Issue
Block a user