protected void fromElement(FbxElement element) { id = FbxId.getObjectId(element); String nameAndClass; if (element.propertiesTypes.length == 3) { nameAndClass = (String) element.properties.get(1); subclassName = (String) element.properties.get(2); } else if (element.propertiesTypes.length == 2) { nameAndClass = (String) element.properties.get(0); subclassName = (String) element.properties.get(1); } else { throw new UnsupportedOperationException("This is not an FBX object: " + element.id); } int splitter = nameAndClass.indexOf("\u0000\u0001"); if (splitter != -1) { name = nameAndClass.substring(0, splitter); className = nameAndClass.substring(splitter + 2); } else { name = nameAndClass; className = null; } }
/** * Creates a map between object UIDs and the objects themselves. * * @param file The file to create the mappings for. * @return The UID to object map. */ private static Map<FbxId, FbxElement> createUidToObjectMap(FbxFile file) { Map<FbxId, FbxElement> uidToObjectMap = new HashMap<FbxId, FbxElement>(); for (FbxElement rootElement : file.rootElements) { if (rootElement.id.equals("Objects")) { for (FbxElement fbxObj : rootElement.children) { FbxId uid = FbxId.getObjectId(fbxObj); if (uid != null) { uidToObjectMap.put(uid, fbxObj); } else { logger.log(Level.WARNING, "Cannot determine ID for object: {0}", fbxObj); } } } } return uidToObjectMap; }
/** * Creates a map between object UIDs and the objects themselves. * * @param file The file to create the mappings for. * @return The UID to object map. */ private static Map<FbxId, FbxElement> createUidToObjectMap(FbxFile file) { Map<FbxId, FbxElement> uidToObjectMap = new HashMap<FbxId, FbxElement>(); for (FbxElement rootElement : file.rootElements) { if (rootElement.id.equals("Objects")) { for (FbxElement fbxObj : rootElement.children) { FbxId uid = FbxId.getObjectId(fbxObj); if (uid != null) { uidToObjectMap.put(uid, fbxObj); } else { logger.log(Level.WARNING, "Cannot determine ID for object: {0}", fbxObj); } } } } return uidToObjectMap; }
protected void fromElement(FbxElement element) { id = FbxId.getObjectId(element); String nameAndClass; if (element.propertiesTypes.length == 3) { nameAndClass = (String) element.properties.get(1); subclassName = (String) element.properties.get(2); } else if (element.propertiesTypes.length == 2) { nameAndClass = (String) element.properties.get(0); subclassName = (String) element.properties.get(1); } else { throw new UnsupportedOperationException("This is not an FBX object: " + element.id); } int splitter = nameAndClass.indexOf("\u0000\u0001"); if (splitter != -1) { name = nameAndClass.substring(0, splitter); className = nameAndClass.substring(splitter + 2); } else { name = nameAndClass; className = null; } }