Skip to content
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

Add implicit instancing support to AlembicAssembly #2424

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

Conversation

Narann
Copy link
Contributor

@Narann Narann commented Feb 14, 2019

As its name states, this commit add implicit instancing in AlembicAssembly using IObject::getPropertyHash() on poly mesh.

The weird part of the code review will be that a tiny refacto appear: I created a do_extract_polymesh() method that put the content of the Alembic IPolyMesh into the appleseed MeshObject. This obfuscate the diff but it make the whole logic easier to read.

@Narann
Copy link
Contributor Author

Narann commented Feb 14, 2019

I also think I should provide some test scene but I have no idea where I should put them. sandbox/samples/cpp/alembicassembly looks weird to me.

@Narann Narann force-pushed the master branch 2 times, most recently from c96d14d to 2513b56 Compare February 21, 2019 22:25
@dictoon
Copy link
Member

dictoon commented Feb 22, 2019

I also think I should provide some test scene but I have no idea where I should put them. sandbox/samples/cpp/alembicassembly looks weird to me.

A testscenes/ subdirectory in sandbox/samples/cpp/alembicassembly/ sounds perfectly acceptable to me.

@dictoon dictoon changed the title add implicit instancing support in AlembicAssembly Add implicit instancing support to AlembicAssembly Feb 22, 2019
@Narann
Copy link
Contributor Author

Narann commented Feb 22, 2019

Thanks, I try to use relative paths in the appleseed XML file:

<parameter name="file_path" value="alembics/xform_ogawa.abc" />

This path is relative to the scene but I suspect I have to resolve it as I'm in bin/Ship when I run appleseed.studio.

Any hint, in the code, where a similar problem is solved?

@Narann
Copy link
Contributor Author

Narann commented Feb 22, 2019

2019-02-22T20:08:03.968452Z <003>   165 MB info    | time_offset: 0.000000
2019-02-22T20:08:03.968452Z <003>   165 MB info    | verbose: true
2019-02-22T20:08:03.969460Z <003>   167 MB warning | invalid archive: alembics/xform_ogawa.abc
2019-02-22T20:08:03.973803Z <001>   167 MB info    | rendering finished in 0 ms.

It's my code logging this: https://github.com/Narann/appleseed/blob/master/sandbox/samples/cpp/alembicassembly/alembicassembly.cpp#L450

So I need to "interpret" a relative file path. Once again, I'm sure you guys already had to deal with that.

@Narann
Copy link
Contributor Author

Narann commented Feb 22, 2019

Reading other scenes, it looks like .obj are always passed relative to the .appleseed scene:

                <object name="Sphere" model="mesh_object">
                    <parameter name="filename" value="meshes/Sphere.obj" />
                </object>

But the obj parser doesn't seems to do anything to convert to absolute path:

if (!impl.m_lexer.open(m_filename))

bool open(const std::string& filename)

So I suspect the working directory used when rendering test scenes must be the place where scenes are.
Am I good ?

@dictoon
Copy link
Member

dictoon commented Feb 23, 2019

So I suspect the working directory used when rendering test scenes must be the place where scenes are.

That's correct: relative paths aren't relative to the project's directory, they're relative to the current directory. You could add . as a search path: relative assets would then be resolved with respect to the project's directory, regardless of the current directory.

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

Successfully merging this pull request may close these issues.

2 participants