Package info.ata4.unity.cli.cmd

Examples of info.ata4.unity.cli.cmd.BundleListCmd


    private void readCompressedMesh() throws IOException {
        CompressedMesh cmesh = mesh.compressedMesh;

        float[] vertexFloats = readPackedFloats(cmesh.vertices);
        for (int i = 0; i < vertexFloats.length / 3; i++) {
            Vector3f v = new Vector3f();
            v.x = vertexFloats[i * 3];
            v.y = vertexFloats[i * 3 + 1];
            v.z = vertexFloats[i * 3 + 2];
            vertices.add(v);
        }

        float[] normalFloats = readPackedNormals(cmesh.normals, cmesh.normalSigns);
        for (int i = 0; i < normalFloats.length / 3; i++) {
            Vector3f vn = new Vector3f();
            vn.x = normalFloats[i * 3];
            vn.y = normalFloats[i * 3 + 1];
            vn.z = normalFloats[i * 3 + 2];
            normals.add(vn);
        }
View Full Code Here


                writeFaceHeader(faceCount);
                writeHeaderEnd();
               
                // write vertices
                for (int j = firstVertex; j < firstVertex + vertexCount; j++) {
                    Vector3f v = vertices.get(j);
                    Vector3f vn = normals.isEmpty() ? null : normals.get(j);
                    Vector2f vt1 = uv1.isEmpty() ? null : uv1.get(j);
                    Vector2f vt2 = uv2.isEmpty() ? null : uv2.get(j);
                    Color32 c = colors.isEmpty() ? null : colors.get(j);
                    writeVertex(v, vn, vt1, vt2, c);
                }
View Full Code Here

                                uv2.add(vt);
                            }
                            break;

                        case CHANNEL_TANGENTS:
                            Vector4f t = new Vector4f();
                            t.setHalf(half);
                            t.read(in);
                            tangents.add(t);
                            break;
                    }
                }
               
View Full Code Here

    private int objTested;
    private int objFailed;

    @Override
    protected void processAsset(AssetFile asset) throws IOException {
        Deserializer deser = new Deserializer(asset);
       
        int objTestedAsset = 0;

        for (ObjectPath path : asset.getPaths()) {
            // skip MonoBehaviours
            if (path.isScript()) {
                continue;
            }

            try {
                deser.deserialize(path);
            } catch (Exception ex) {
                L.log(Level.INFO, "Deserialization failed for " + path, ex);
                objFailed++;

                if (getOptions().isVerbose()) {
                    // try again in debug mode
                    deser.setDebug(true);
                    try {
                        deser.deserialize(path);
                    } catch (Exception ex2) {
                    }
                    deser.setDebug(false);
                }
            }

            objTestedAsset++;
            objTested++;
View Full Code Here

     * @param path object path
     * @return Name string of the object or null if it doesn't have a name or if
     *         the deserialization failed.
     */
    public static String getObjectName(AssetFile asset, ObjectPath path) {
        Deserializer deser = new Deserializer(asset);
        String name = null;
       
        try {
            UnityObject obj = deser.deserialize(path);
            name = obj.getValue("m_Name");
        } catch (OutOfMemoryError ex) {
            // Deserializer choked on an array size and clogged the heap, try
            // to clean up this mess
            deser = null;
View Full Code Here

        this.cf = cf;
    }

    public void extract(boolean raw) throws IOException {
        List<ObjectPath> paths = asset.getPaths();
        Deserializer deser = new Deserializer(asset);

        for (AssetExtractHandler extractHandler : extractHandlerMap.values()) {
            extractHandler.setAssetFile(asset);
            extractHandler.setOutputDir(outputDir);
        }
       
        for (ObjectPath path : paths) {
            // skip filtered classes
            if (cf != null && !cf.accept(path)) {
                continue;
            }
           
            String className = ClassID.getNameForID(path.getClassID(), true);

            // write just the serialized object data or parsed and extracted content?
            if (raw) {
                String assetFileName = String.format("%06d.bin", path.getPathID());
                Path classDir = outputDir.resolve(className);
                if (Files.notExists(classDir)) {
                    Files.createDirectories(classDir);
                }
               
                Path assetFile = classDir.resolve(assetFileName);
               
                L.log(Level.INFO, "Writing {0} {1}", new Object[] {className, assetFileName});
               
                ByteBuffer bbAsset = asset.getPathBuffer(path);
               
                try {
                    ByteBufferUtils.save(assetFile, bbAsset);
                } catch (Exception ex) {
                    L.log(Level.WARNING, "Can't write " + path + " to " + assetFile, ex);
                }
            } else {
                AssetExtractHandler handler = getHandler(className);
               
                if (handler != null) {
                    UnityObject obj;
                   
                    try {
                        obj = deser.deserialize(path);
                    } catch (Exception ex) {
                        L.log(Level.WARNING, "Can't deserialize " + path, ex);
                        continue;
                    }
                   
View Full Code Here

    public void setClassFilter(ClassFilter cf) {
        this.cf = cf;
    }
   
    public void dumpData() throws IOException {
        Deserializer deser = new Deserializer(asset);

        for (ObjectPath path : asset.getPaths()) {
            // skip MonoBehaviours
            if (path.isScript()) {
                continue;
            }

            // skip filtered classes
            if (cf != null && !cf.accept(path)) {
                continue;
            }

            UnityObject obj;
           
            try {
                obj = deser.deserialize(path);
            } catch (Exception ex) {
                L.log(Level.SEVERE, "Deserialization failed for " + path, ex);
                continue;
            }
           
View Full Code Here

    public static String getObjectName(AssetFile asset, ObjectPath path) {
        Deserializer deser = new Deserializer(asset);
        String name = null;
       
        try {
            UnityObject obj = deser.deserialize(path);
            name = obj.getValue("m_Name");
        } catch (OutOfMemoryError ex) {
            // Deserializer choked on an array size and clogged the heap, try
            // to clean up this mess
            deser = null;
            System.gc();
View Full Code Here

                }
            } else {
                AssetExtractHandler handler = getHandler(className);
               
                if (handler != null) {
                    UnityObject obj;
                   
                    try {
                        obj = deser.deserialize(path);
                    } catch (Exception ex) {
                        L.log(Level.WARNING, "Can't deserialize " + path, ex);
View Full Code Here

            // skip filtered classes
            if (cf != null && !cf.accept(path)) {
                continue;
            }

            UnityObject obj;
           
            try {
                obj = deser.deserialize(path);
            } catch (Exception ex) {
                L.log(Level.SEVERE, "Deserialization failed for " + path, ex);
View Full Code Here

TOP

Related Classes of info.ata4.unity.cli.cmd.BundleListCmd

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.