ID 234065 - ScenegraphXML does not support modifiers

Follow

Problem summary:

The ScenegraphXML file format supports associating an AttributeFile with a location. Our SGXML readers (i.e. either the ScenegraphXml_In node or ScenegraphXML Scene Graph Generator plug-in) declare these modifier in an `attributeModifiers` attribute group in the scene graph. There are two problems with this:

  1. Since Katana 2.0, an additional AttributeUpgrade node is necessary to convert the `attributeModifiers` group to an `ops` group. AttributeUpgrade nodes are used to upgrade scene data with Katana 1.x attribute conventions for use with Katana 2.0. Scene data that is freshly generated, rather than data baked from Katana 1.x, shouldn't need to be upgraded using AttributeUpgrade nodes.
  2. Since Katana 2.5, the AttributeFile AMP no longer exists. This can be worked around by munging the attributes such that the `AttributeFile_In` Op is called, rather than `AttributeModifierHost`.

Steps to reproduce:

  1. Extract sgxml_attributefile.tar.gz (attached)
  2. Open sgxml_attributefile.katana
  3. View from the ScenegraphXml_In node
  4. In the Scene Graph tab, select /root/world/geo/geometry/geo/pCube1/pCubeShape1

Expected behaviour:

The location has a `param` attribute set to `mat1`.

Actual behaviour:

The `param` attribute is not set.

Workaround:

The following OpScript modifies the attributes into the correct convention:


local attributeModifiersAttr = Interface.GetAttr("attributeModifiers")if attributeModifiersAttr ~= nil then  for i = 0, attributeModifiersAttr:getNumberOfChildren() - 1 do    local modifierAttr = attributeModifiersAttr:getChildByIndex(i)    local modifierName = attributeModifiersAttr:getChildName(i)    if modifierAttr:getChildByName("type"):getValue() == "AttributeFile" then      local gb = GroupBuilder()      gb:set("opType", StringAttribute("AttributeFile_In"))      gb:set("opArgs", modifierAttr:getChildByName("args"))      gb:set("recursiveEnable", modifierAttr:getChildByName("recursiveEnable"))      Interface.SetAttr("ops." .. modifierName, gb:build())      Interface.DeleteAttr("attributeModifiers." .. modifierName)    end  endend

Reproduced versions/platforms:

  • 2.5v3/Linux

Customer version/platform:

2.5v3/Linux

    We're sorry to hear that

    Please tell us why