def __init__(self, path, data, binary_buffer=None):
        """
        :param file: GLTF file name loaded
        :param data: Metadata (json loaded)
        :param binary_buffer: Binary buffer when loading glb files
        """
        self.data = data
        self.path = path
        self.asset = GLTFAsset(data['asset'])
        self.materials = [GLTFMaterial(m) for m in data['materials']] if data.get('materials') else []
        self.images = [GLTFImage(i) for i in data['images']] if data.get('images') else []
        self.samplers = [GLTFSampler(s) for s in data['samplers']] if data.get('samplers') else []
        self.textures = [GLTFTexture(t) for t in data['textures']] if data.get('textures') else []
        self.scenes = [GLTFScene(s) for s in data['scenes']] if data.get('scenes') else []
        self.nodes = [GLTFNode(n) for n in data['nodes']] if data.get('nodes') else []
        self.meshes = [GLTFMesh(m) for m in data['meshes']] if data.get('meshes') else []
        self.cameras = [GLTFCamera(c) for c in data['cameras']] if data.get('cameras') else []
        self.buffer_views = [GLTFBufferView(i, v) for i, v in enumerate(data['bufferViews'])] \
            if data.get('bufferViews') else []
        self.buffers = [GLTFBuffer(i, b, self.path.parent) for i, b in enumerate(data['buffers'])] \
            if data.get('buffers') else []
        self.accessors = [GLTFAccessor(i, a) for i, a in enumerate(data['accessors'])] \
            if data.get('accessors') else []

        # glb files can contain buffer 0 data
        if binary_buffer:
            self.buffers[0].data = binary_buffer

        self._link_data()

        self.buffers_exist()
        self.images_exist()
def __init__ ( self , path , data , binary_buffer = None ) : self . data = data self . path = path self . asset = GLTFAsset ( data [ 'asset' ] ) self . materials = [ GLTFMaterial ( m ) for m in data [ 'materials' ] ] if data . get ( 'materials' ) else [ ] self . images = [ GLTFImage ( i ) for i in data [ 'images' ] ] if data . get ( 'images' ) else [ ] self . samplers = [ GLTFSampler ( s ) for s in data [ 'samplers' ] ] if data . get ( 'samplers' ) else [ ] self . textures = [ GLTFTexture ( t ) for t in data [ 'textures' ] ] if data . get ( 'textures' ) else [ ] self . scenes = [ GLTFScene ( s ) for s in data [ 'scenes' ] ] if data . get ( 'scenes' ) else [ ] self . nodes = [ GLTFNode ( n ) for n in data [ 'nodes' ] ] if data . get ( 'nodes' ) else [ ] self . meshes = [ GLTFMesh ( m ) for m in data [ 'meshes' ] ] if data . get ( 'meshes' ) else [ ] self . cameras = [ GLTFCamera ( c ) for c in data [ 'cameras' ] ] if data . get ( 'cameras' ) else [ ] self . buffer_views = [ GLTFBufferView ( i , v ) for i , v in enumerate ( data [ 'bufferViews' ] ) ] if data . get ( 'bufferViews' ) else [ ] self . buffers = [ GLTFBuffer ( i , b , self . path . parent ) for i , b in enumerate ( data [ 'buffers' ] ) ] if data . get ( 'buffers' ) else [ ] self . accessors = [ GLTFAccessor ( i , a ) for i , a in enumerate ( data [ 'accessors' ] ) ] if data . get ( 'accessors' ) else [ ] if binary_buffer : self . buffers [ 0 ] . data = binary_buffer self . _link_data ( ) self . buffers_exist ( ) self . images_exist ( )
:param file: GLTF file name loaded
        :param data: Metadata (json loaded)
        :param binary_buffer: Binary buffer when loading glb files