forked from blender/blender
Refactor code after PR #57 #67
@ -266,6 +266,10 @@ pxr::SdfPath BlenderSceneDelegate::world_prim_id() const
|
||||
|
||||
ObjectData *BlenderSceneDelegate::object_data(pxr::SdfPath const &id) const
|
||||
{
|
||||
if (id == world_prim_id()) {
|
||||
return world_data_.get();
|
||||
}
|
||||
|
||||
pxr::SdfPath p_id = (id.GetName().find("SM_") == 0 || id.GetName().find("VF_") == 0) ?
|
||||
id.GetParentPath() :
|
||||
id;
|
||||
@ -273,6 +277,7 @@ ObjectData *BlenderSceneDelegate::object_data(pxr::SdfPath const &id) const
|
||||
if (obj_data) {
|
||||
return obj_data->get();
|
||||
}
|
||||
|
||||
InstancerData *i_data = instancer_data(p_id, true);
|
||||
if (i_data) {
|
||||
return i_data->object_data(id);
|
||||
@ -297,9 +302,6 @@ VolumeData *BlenderSceneDelegate::volume_data(pxr::SdfPath const &id) const
|
||||
|
||||
LightData *BlenderSceneDelegate::light_data(pxr::SdfPath const &id) const
|
||||
{
|
||||
if (id == world_prim_id()) {
|
||||
return world_data_.get();
|
||||
}
|
||||
return dynamic_cast<LightData *>(object_data(id));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user