/** * Dump FBX to the given output stream. * * @param file the file to dump. * @param out the output stream where to output. */ public static void dumpFile(FbxFile file, OutputStream out) { Map<FbxId, FbxElement> uidToObjectMap = createUidToObjectMap(file); PrintStream ps = new PrintStream(out); for (FbxElement rootElement : file.rootElements) { dumpElement(rootElement, ps, 0, uidToObjectMap); } }
/** * Dump FBX to standard output. * * @param file the file to dump. */ public static void dumpFile(FbxFile file) { dumpFile(file, System.out); }
protected static void dumpElement(FbxElement el, PrintStream ps, int indent, Map<FbxId, FbxElement> uidToObjectMap) { String indentStr = indent(indent * 4); String textId = el.id; Object property = el.properties.get(i); char propertyType = el.propertiesTypes[i]; dumpProperty(el.id, propertyType, property, ps, uidToObjectMap); if (i != el.properties.size() - 1) { ps.print(", "); ps.println(" {"); for (FbxElement childElement : el.children) { dumpElement(childElement, ps, indent + 1, uidToObjectMap);
ps.print("\"" + convertFBXString(str) + "\""); break; case 'R': if (element != null) { String name = (String) element.properties.get(1); ps.print("\"" + convertFBXString(name) + "\""); } else { ps.print(property); for (int j = 0; j < length; j++) { Object arrayEntry = Array.get(property, j); dumpProperty(id, Character.toUpperCase(propertyType), arrayEntry, ps, uidToObjectMap); if (j != length - 1) { ps.print(",");
ps.print("\"" + convertFBXString(str) + "\""); break; case 'R': if (element != null) { String name = (String) element.properties.get(1); ps.print("\"" + convertFBXString(name) + "\""); } else { ps.print(property); for (int j = 0; j < length; j++) { Object arrayEntry = Array.get(property, j); dumpProperty(id, Character.toUpperCase(propertyType), arrayEntry, ps, uidToObjectMap); if (j != length - 1) { ps.print(",");
protected static void dumpElement(FbxElement el, PrintStream ps, int indent, Map<FbxId, FbxElement> uidToObjectMap) { String indentStr = indent(indent * 4); String textId = el.id; Object property = el.properties.get(i); char propertyType = el.propertiesTypes[i]; dumpProperty(el.id, propertyType, property, ps, uidToObjectMap); if (i != el.properties.size() - 1) { ps.print(", "); ps.println(" {"); for (FbxElement childElement : el.children) { dumpElement(childElement, ps, indent + 1, uidToObjectMap);
/** * Dump FBX to the given output stream. * * @param file the file to dump. * @param out the output stream where to output. */ public static void dumpFile(FbxFile file, OutputStream out) { Map<FbxId, FbxElement> uidToObjectMap = createUidToObjectMap(file); PrintStream ps = new PrintStream(out); for (FbxElement rootElement : file.rootElements) { dumpElement(rootElement, ps, 0, uidToObjectMap); } }
private void loadData(InputStream stream) throws IOException { FbxFile scene = FbxReader.readFBX(stream); FbxDump.dumpFile(scene); // TODO: Load FBX object templates for (FbxElement e : scene.rootElements) { if (e.id.equals("FBXHeaderExtension")) { loadHeader(e); } else if (e.id.equals("GlobalSettings")) { loadGlobalSettings(e); } else if (e.id.equals("Objects")) { loadObjects(e); } else if (e.id.equals("Connections")) { connectObjects(e); } } }
/** * Dump FBX to standard output. * * @param file the file to dump. */ public static void dumpFile(FbxFile file) { dumpFile(file, System.out); }
private void loadData(InputStream stream) throws IOException { FbxFile scene = FbxReader.readFBX(stream); FbxDump.dumpFile(scene); // TODO: Load FBX object templates for (FbxElement e : scene.rootElements) { if (e.id.equals("FBXHeaderExtension")) { loadHeader(e); } else if (e.id.equals("GlobalSettings")) { loadGlobalSettings(e); } else if (e.id.equals("Objects")) { loadObjects(e); } else if (e.id.equals("Connections")) { connectObjects(e); } } }