-
Notifications
You must be signed in to change notification settings - Fork 13
--savemesh argument in example 12 #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
12_MeshLoaders/main.cpp
Outdated
auto& asset = m_currentBundle.getContents()[0]; | ||
IAssetWriter::SAssetWriteParams params{ asset.get() }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only what you're intending to write shall be kept
12_MeshLoaders/main.cpp
Outdated
auto savePath = (prefix / path(m_modelPath).filename()).generic_string(); | ||
|
||
m_logger->log("Saving mesh to %S", ILogger::ELL_INFO, savePath.c_str()); | ||
// TODO (Yas): learn how to get out the geometry from renderer and transform it into IAsset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't go from IGPUObject to ICPUObject easily
12_MeshLoaders/main.cpp
Outdated
// make save path | ||
static const auto prefix = std::filesystem::absolute("saved/"); | ||
|
||
if (!std::filesystem::exists(prefix)) | ||
m_system->createDirectory(prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path is wrong, see the 4 CWD members of the apocalypse in the basic framework app
12_MeshLoaders/main.cpp
Outdated
@@ -197,22 +197,9 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc | |||
|
|||
inline bool onAppTerminated() override | |||
{ | |||
if (m_saveMeshOnExit) | |||
if (m_saveGeomOnExit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check for current geom
12_MeshLoaders/main.cpp
Outdated
// should I do a const cast here? | ||
const IAsset* asset = m_currentGeom.get(); | ||
IAssetWriter::SAssetWriteParams params{ const_cast<IAsset*>(asset) }; | ||
m_assetMgr->writeAsset(savePath, params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after writing out once, the `m_currentGeom needs to be nulled out
…hen invalid path has been selected
No description provided.