MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / initialize

Method initialize

source/MaterialXGraphEditor/RenderView.cpp:173–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void RenderView::initialize()
174{
175 // Initialize image handler.
176 _imageHandler = mx::GLTextureHandler::create(mx::StbImageLoader::create());
177#if MATERIALX_BUILD_OIIO
178 _imageHandler->addLoader(mx::OiioImageLoader::create());
179#endif
180 _imageHandler->setSearchPath(_searchPath);
181
182 // Create geometry handler.
183 mx::TinyObjLoaderPtr objLoader = mx::TinyObjLoader::create();
184 mx::CgltfLoaderPtr gltfLoader = mx::CgltfLoader::create();
185 _geometryHandler = mx::GeometryHandler::create();
186 _geometryHandler->addLoader(objLoader);
187 _geometryHandler->addLoader(gltfLoader);
188 loadMesh(_searchPath.find(_meshFilename));
189
190 // Initialize environment light.
191 loadEnvironmentLight();
192
193 // Initialize camera.
194 initCamera();
195
196 // Update geometry selections.
197 updateGeometrySelections();
198
199 _pixelRatio = 1.f;
200}
201
202void RenderView::assignMaterial(mx::MeshPartitionPtr geometry, mx::GlslMaterialPtr material)
203{

Callers 1

GraphMethod · 0.45

Calls 3

createFunction · 0.50
addLoaderMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected