MCPcopy Create free account
hub / github.com/cogentcore/core / OpenToLibrary

Method OpenToLibrary

xyz/io.go:197–203  ·  view source on GitHub ↗

OpenToLibrary opens object(s) from given file into the scene's Library using a decoder based on the file extension. The library key name must be unique, and is given by libnm -- if empty, then the filename (only) without extension is used. Supported formats include: .obj = Wavefront OBJ format, inc

(fname string, libnm string)

Source from the content-addressed store, hash-verified

195//
196// must have same name as .obj, or a default material is used.
197func (sc *Scene) OpenToLibrary(fname string, libnm string) (*Group, error) {
198 dfs, fnm, err := fsx.DirFS(fname)
199 if err != nil {
200 return nil, err
201 }
202 return sc.OpenToLibraryFS(dfs, fnm, libnm)
203}
204
205// OpenToLibraryFS opens object(s) from given file in the given filesystem into the scene's Library
206// using a decoder based on the file extension. The library key name

Callers

nothing calls this directly

Calls 2

OpenToLibraryFSMethod · 0.95
DirFSFunction · 0.92

Tested by

no test coverage detected