GetComposedObjectTransformsMemorySafe() public static method

Fill in array of HAPI_Transform list. Use for large arrays where marshalling is done in chunks.
public static GetComposedObjectTransformsMemorySafe ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_RSTOrder rstOrder, Array transforms, int start, int length ) : bool
session HEU_SessionBase
nodeID HAPI_NodeId The parent node ID
rstOrder HAPI_RSTOrder Transform order
transforms Array Array to fill. Should at least be size of length
start int At least 0 and at most object count returned by ComposeObjectList
length int Object count returned by ComposeObjectList. Should be at least 0 and at most object count - start
return bool
        /// <summary>
        /// Gets the object infos and transforms for given asset.
        /// </summary>
        /// <param name="assetID">ID of the asset</param>
        /// <param name="nodeInfo">HAPI_NodeInfo of the asset</param>
        /// <param name="objectInfos">Array of retrieved object infos</param>
        /// <param name="objectTransforms">Array of retrieved object transforms</param>
        /// <returns>True if succesfully retrieved object infos and transforms</returns>
        public static bool GetObjectInfos(HEU_SessionBase session, HAPI_NodeId assetID, ref HAPI_NodeInfo nodeInfo, out HAPI_ObjectInfo[] objectInfos, out HAPI_Transform[] objectTransforms)
        {
            objectInfos      = new HAPI_ObjectInfo[0];
            objectTransforms = new HAPI_Transform[0];

            if (nodeInfo.type == HAPI_NodeType.HAPI_NODETYPE_SOP)
            {
                // For SOP assets, we use the parent IDs to get the object info and geo info

                objectInfos = new HAPI_ObjectInfo[1];
                if (!session.GetObjectInfo(nodeInfo.parentId, ref objectInfos[0]))
                {
                    return(false);
                }

                // Identity transform will be used for SOP assets, so not querying transform
                objectTransforms    = new HAPI_Transform[1];
                objectTransforms[0] = new HAPI_Transform(true);
            }
            else if (nodeInfo.type == HAPI_NodeType.HAPI_NODETYPE_OBJ)
            {
                int objectCount = 0;
                if (!session.ComposeObjectList(assetID, out objectCount))
                {
                    return(false);
                }

                if (objectCount <= 0)
                {
                    // Since this asset is an object type and has 0 object as children, we use the object itself

                    objectInfos = new HAPI_ObjectInfo[1];
                    if (!session.GetObjectInfo(nodeInfo.id, ref objectInfos[0]))
                    {
                        return(false);
                    }

                    // Identity transform will be used for single object assets, so not querying transform
                    objectTransforms    = new HAPI_Transform[1];
                    objectTransforms[0] = new HAPI_Transform(true);
                }
                else
                {
                    // This object has children, so use GetComposedObjectList to get list of HAPI_ObjectInfos

                    objectInfos = new HAPI_ObjectInfo[objectCount];
                    if (!session.GetComposedObjectList(nodeInfo.parentId, objectInfos, 0, objectCount))
                    {
                        return(false);
                    }

                    // Now get the object transforms
                    objectTransforms = new HAPI_Transform[objectCount];
                    if (!HEU_SessionManager.GetComposedObjectTransformsMemorySafe(session, nodeInfo.parentId, HAPI_RSTOrder.HAPI_SRT, objectTransforms, 0, objectCount))
                    {
                        return(false);
                    }
                }
            }
            else
            {
                Debug.LogWarningFormat(HEU_Defines.HEU_NAME + ": Unsupported node type {0}", nodeInfo.type);
                return(false);
            }

            return(true);
        }