예제 #1
0
void hkvTextureAsset::setSpecificProperty(const hkvProperty& prop, const hkArray<hkStringPtr>& path, unsigned int stackIndex, hkvProperty::Purpose purpose)
{
  int stackSize = (path.getSize() - stackIndex);

  if ((stackSize == 1) && (hkvStringHelper::safeCompare(path.back(), "Texture") == 0))
  {
    m_imageProperties.setProperty(prop, path, stackIndex + 1, purpose);
    
    // Usage is still present here for backwards compatibility to convert older asset libraries, but has now moved to the texture transform rule instead.
    if (hkvStringHelper::safeCompare(prop.getName(), "Usage") == 0)
    {
      if (purpose == hkvProperty::PURPOSE_SERIALIZATION)
      {
        if (m_usageInstance.setByString(prop.getString()) != HK_SUCCESS)
        {
          m_usageInstance.setByAvailableElementsId(0);
        }
      }
    }
    else if (hkvStringHelper::safeCompare(prop.getName(), "sRGB") == 0)
    {
      m_sRgb = prop.getBool();
    }
  }
}
예제 #2
0
void hkvTextureAsset::setSpecificProperty(const hkvProperty& prop, const hkArray<hkStringPtr>& path, unsigned int stackIndex, hkvProperty::Purpose purpose)
{
    int stackSize = (path.getSize() - stackIndex);

    if ((stackSize == 1) && (hkvStringHelper::safeCompare(path.back(), "Texture") == 0))
    {
        m_imageProperties.setProperty(prop, path, stackIndex + 1, purpose);

        if (hkvStringHelper::safeCompare(prop.getName(), "Usage") == 0)
        {
            if (purpose == hkvProperty::PURPOSE_SERIALIZATION)
            {
                if (m_usageInstance.setByString(prop.getString()) != HK_SUCCESS)
                {
                    m_usageInstance.setByAvailableElementsId(0);
                }
            }
            else
            {
                m_usageInstance.setByAvailableElementsId(prop.getEnumValue());
            }
        }
        else if (hkvStringHelper::safeCompare(prop.getName(), "sRGB") == 0)
        {
            m_sRgb = prop.getBool();
        }
    }
}
void hkvStaticMeshAsset::setSpecificProperty(const hkvProperty& prop, const hkArray<hkStringPtr>& path, unsigned int stackIndex, hkvProperty::Purpose purpose)
{
  int stackSize = (path.getSize() - stackIndex);

  if ((stackSize == 1) && (hkvStringHelper::safeCompare(path.back(), "Model") == 0))
  {
    if (hkvStringHelper::safeCompare(prop.getName(), "LODSwitchDistances") == 0)
    {
      m_lodDistances = prop.getArray();
    }
  }
}