Coder Social home page Coder Social logo

demkeys / unity-gltf-importer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 30 KB

A very basic glTF importer for Unity. Made for educational purposes.

C# 100.00%
gltf gltf-format unity3d gltf2-loader unity3d-plugin unity-plugin gltf2 importer unity

unity-gltf-importer's Issues

Already existing materials (same name) get overridden on import

Scenario:
Asset A1 is imported. A1's MeshRenderer expects a material M1, so material M1 is created during the import process and a reference to it is added in the A1 prefab's MeshRenderer.
Then Asset A2 is imported. A2's MeshRenderer also expects a material named M1 so the importer creates a new material asset named M1 and adds a reference to it in A2's prefab. This causes the previous M1 material asset to get overridden. Somehow there is still an M1 material attach to A1's MeshRenderer, but it is not linked to any asset.

Possible solution:
Before creating the material M1 object and asset, scan the current folder to see if a material M1 asset already exists. If yes, load the material object from that asset and add a reference to that in A1's MeshRenderer. If no, the proceed with creating a name material object and asset. As a result, when A2 gets imported, if should then have a reference to the earlier created M1 material, and will not try to create it's own M1 material, but will instead add a reference to that material.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.