MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / exportItem

Method exportItem

Components/SceneFormat/src/OgreSceneFormatExporter.cpp:398–439  ·  view source on GitHub ↗

-----------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

396 }
397 //-----------------------------------------------------------------------------------
398 void SceneFormatExporter::exportItem( LwString &jsonStr, String &outJson, Item *item,
399 bool exportMesh )
400 {
401 const Mesh *mesh = item->getMesh().get();
402
403 outJson += "\n\t\t\t\"mesh\" : \"";
404 outJson += mesh->getName();
405 outJson += "\"";
406
407 outJson += ",\n\t\t\t\"mesh_resource_group\" : \"";
408 outJson += mesh->getGroup();
409 outJson += "\"";
410
411 outJson += ",\n";
412 exportMovableObject( jsonStr, outJson, item );
413
414 outJson += ",\n\t\t\t\"sub_items\" :\n\t\t\t[";
415 const size_t numSubItems = item->getNumSubItems();
416 for( size_t i = 0; i < numSubItems; ++i )
417 {
418 if( i != 0 )
419 outJson += ",\n";
420 else
421 outJson += "\n";
422 outJson += "\t\t\t\t{";
423 exportRenderable( jsonStr, outJson, item->getSubItem( i ) );
424 outJson += "\t\t\t\t}";
425 }
426 outJson += "\n\t\t\t]";
427
428 // Export the mesh, if we haven't done that already
429 if( exportMesh && mExportedMeshes.find( mesh ) == mExportedMeshes.end() &&
430 mListener->exportMesh( mesh ) )
431 {
432 FileSystemLayer::createDirectory( mCurrentExportFolder + "/v2/" );
433
434 Ogre::MeshSerializer meshSerializer( mRoot->getRenderSystem()->getVaoManager() );
435 meshSerializer.exportMesh( mesh, mCurrentExportFolder + "/v2/" + mesh->getName(),
436 MESH_VERSION_LATEST );
437 mExportedMeshes.insert( mesh );
438 }
439 }
440 //-----------------------------------------------------------------------------------
441 void SceneFormatExporter::exportLight( LwString &jsonStr, String &outJson, Light *light )
442 {

Callers 1

_exportSceneMethod · 0.45

Calls 10

getNumSubItemsMethod · 0.80
getSubItemMethod · 0.80
getVaoManagerMethod · 0.80
getMethod · 0.45
getNameMethod · 0.45
findMethod · 0.45
endMethod · 0.45
exportMeshMethod · 0.45
getRenderSystemMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected