Package info.ata4.unity.util

Examples of info.ata4.unity.util.UnityVersion


                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);
                }

                // write faces
                List<Integer> faceTriangles = new ArrayList<>();
View Full Code Here


                            colors.add(c);
                            break;

                        case CHANNEL_UV1:
                        case CHANNEL_UV2:
                            Vector2f vt = new Vector2f();
                            vt.setHalf(half);
                            vt.read(in);
                            if (j == CHANNEL_UV1) {
                                uv1.add(vt);
                            } else {
                                uv2.add(vt);
                            }
View Full Code Here

            normals.add(vn);
        }

        float[] uvFloats = readPackedFloats(cmesh.UV);
        for (int i = 0; i < uvFloats.length / 2; i++) {
            Vector2f vt = new Vector2f();
            vt.x = uvFloats[i * 2];
            vt.y = uvFloats[i * 2 + 1];
            if (i < vertexFloats.length / 3) {
                uv1.add(vt);
            } else {
View Full Code Here

               
                // 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);
                }

                // write faces
View Full Code Here

                        half = channel.format == 1;
                    }

                    switch (j) {
                        case CHANNEL_VERTS:
                            Vector3f v = new Vector3f();
                            v.setHalf(half);
                            v.read(in);
                            vertices.add(v);
                            break;

                        case CHANNEL_NORMALS:
                            Vector3f vn = new Vector3f();
                            vn.setHalf(half);
                            vn.read(in);
                            normals.add(vn);
                            if (half && channel != null && channel.dimension == 4) {
                                in.skipBytes(2); // padding?
                            }
                            break;
View Full Code Here

    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

TOP

Related Classes of info.ata4.unity.util.UnityVersion

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.