Skip to content

--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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

YasInvolved
Copy link
Contributor

No description provided.

Comment on lines 213 to 214
auto& asset = m_currentBundle.getContents()[0];
IAssetWriter::SAssetWriteParams params{ asset.get() };

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

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

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

Comment on lines 443 to 447
// make save path
static const auto prefix = std::filesystem::absolute("saved/");

if (!std::filesystem::exists(prefix))
m_system->createDirectory(prefix);

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

@@ -197,22 +197,9 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc

inline bool onAppTerminated() override
{
if (m_saveMeshOnExit)
if (m_saveGeomOnExit)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check for current geom

// 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);

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants