Skip to content

Commit

Permalink
Fix animation rigged referenced scenes transform issue (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
DMotorygin authored Nov 14, 2023
1 parent bd2a9e5 commit e0adc43
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions FireRender.Maya.Src/Context/FireRenderContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ class FireRenderContext : public IFireRenderContextInfo
{
assert(!uuid.empty());

#ifdef _DEBUG
std::string uuidNameWithoutInstanceIndex = FireRenderObject::uuidWithoutInstanceNumberForString(uuid);
#endif

auto it = m_mainMeshesDictionary.find(FireRenderObject::uuidWithoutInstanceNumberForString(uuid));

if (it != m_mainMeshesDictionary.end())
Expand Down
11 changes: 10 additions & 1 deletion FireRender.Maya.Src/FireRenderObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ std::string FireRenderObject::uuidWithoutInstanceNumber() const

std::string FireRenderObject::uuidWithoutInstanceNumberForString(const std::string& uuid)
{
return splitString<std::string>(uuid, ':')[0];
size_t pos = uuid.find_last_of(":");
if (pos == std::string::npos)
return uuid;

if (!isNumber<std::string>(uuid.substr(pos + 1, std::string::npos)))
return uuid;

std::string ret = uuid.substr(0, pos);

return ret;
}

void FireRenderObject::setDirty()
Expand Down
6 changes: 6 additions & 0 deletions FireRender.Maya.Src/FireRenderUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,12 @@ std::vector<T> splitString(const T& s, typename T::traits_type::char_type delim)
return elems;
}

template <class T>
bool isNumber(const std::string& s)
{
return !s.empty() && std::all_of(s.begin(), s.end(), ::isdigit);
}

// Backdoor to enable different AOVs from Render Settings in IPR and Viewport
void EnableAOVsFromRSIfEnvVarSet(FireRenderContext& context, FireRenderAOVs& aovs);

Expand Down
10 changes: 9 additions & 1 deletion FireRender.Maya.Src/frWrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3787,7 +3787,15 @@ namespace frw
{
rpr_int res = rprMaterialNodeSetID(Handle(), id);

assert(res == MStatus::kSuccess);
if (res == RPR_ERROR_UNSUPPORTED ||
res == RPR_ERROR_INVALID_PARAMETER)
{
// should not cancel execution if such error happens
}
else
{
checkStatus(res);
}
}

};
Expand Down

0 comments on commit e0adc43

Please sign in to comment.