[Bf-blender-cvs] [32396f30a97] cycles_procedural_api: make use of the used_shaders from the AlembicObject instead of the ones from the Geometry
Kévin Dietrich
noreply at git.blender.org
Sun Dec 6 06:26:28 CET 2020
Commit: 32396f30a972b01ecd9315dc9cbae30646113457
Author: Kévin Dietrich
Date: Thu Dec 3 16:53:43 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rB32396f30a972b01ecd9315dc9cbae30646113457
make use of the used_shaders from the AlembicObject instead of the ones
from the Geometry
===================================================================
M intern/cycles/render/alembic.cpp
===================================================================
diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index bb87a56a909..0214054d7ea 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -453,9 +453,6 @@ bool AlembicObject::has_data_loaded() const
void AlembicObject::read_face_sets(IPolyMeshSchema &schema, array<int> &polygon_to_shader)
{
- Geometry *geometry = object->get_geometry();
- assert(geometry);
-
/* TODO(@kevindietrich) at the moment this is only supported for meshes whose topology remains
* constant (with possible vertex animation) */
if (schema.getTopologyVariance() == kHeterogenousTopology) {
@@ -476,7 +473,7 @@ void AlembicObject::read_face_sets(IPolyMeshSchema &schema, array<int> &polygon_
foreach (const std::string &face_set_name, face_sets) {
int shader_index = 0;
- foreach (Node *node, geometry->get_used_shaders()) {
+ foreach (Node *node, get_used_shaders()) {
if (node->name == face_set_name) {
break;
}
@@ -484,8 +481,9 @@ void AlembicObject::read_face_sets(IPolyMeshSchema &schema, array<int> &polygon_
++shader_index;
}
- if (shader_index >= geometry->get_used_shaders().size()) {
- continue;
+ if (shader_index >= get_used_shaders().size()) {
+ /* use the first shader instead if none was found */
+ shader_index = 0;
}
const IFaceSet face_set = schema.getFaceSet(face_set_name);
More information about the Bf-blender-cvs
mailing list