-
Notifications
You must be signed in to change notification settings - Fork 23
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
JS Bindings: Improve setup and build instructions #1258
JS Bindings: Improve setup and build instructions #1258
Conversation
4e29b8d
to
c7891f4
Compare
@@ -107,7 +107,7 @@ describe('Code Examples', () => { | |||
} | |||
} | |||
expect(elementCount).to.equal(21); | |||
expect(nodeCount).to.equal(5); | |||
expect(nodeCount).to.equal(1); |
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.
Was this passing before? What params takes isANode, sounds weird to take params but, I guess it is just part of the API.
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.
It was passing before, because we used another check in the loop (instanceof mx.Node
vs isANode('image')
). So now we're only looking at image nodes explicitly, whereas before all nodes where counted. That's also the answer the other question: The parameter of isANode
is the node type to check for, e.g. image.
|
||
#### Docker | ||
It is recommended to build the project with Docker, here are the required steps: | ||
Setting the environment variables permanently is also possible, either by adding a `--permanent` flag to the `activate` command, or by sourcing the `emsdk_env` script every time a shell is launched, e.g. by adding the `source` call to `~/.bash_profile` or an equivalent file. Note however, that the environment variables set by the emscripten SDK might override existing system settings, like the default Python, Java or NodeJs version, so setting them permanently might not be desired on all systems. |
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.
Wow, learned something new with the --permanent flag 😄
```sh | ||
cmake .. -DMATERIALX_BUILD_JS=ON -DMATERIALX_BUILD_RENDER=OFF -DMATERIALX_BUILD_TESTS=OFF -DMATERIALX_EMSDK_PATH=C:\GitHub\PUBLIC\emsdk -G "Ninja" | ||
cmake --build . | ||
docker run --rm -v {path_to_MaterialX_repo}:/src emscripten/emsdk sh -c "cd build && <cmake generator command> && <cmake build command>" |
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.
just personal flavor since I skim through readmes looking for the most important info. Can we link cmake generator command to the command above
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.
I tried to do that, but I couldn't find a way to link from within a code block.
- Adds Metal Support to MaterialXShaderGen Backend - Adds Metal Support to MaterialX Rendering code for testing generated shaders - Adds Metal Support to MaterialXView Rendering Support (switchable between Metal and OpenGL, default is Metal)
This PR consolidates the setup and build instructions in the readme by
Furthermore, once of the examples in
codeExamples.md
is updated. The other ones still need to changed, once we know how they should look like (C++ and Python and outdated atm).A note for reviewers: It might make sense to look at the updated document separately to read the instructions in one piece, instead of trying to follow them in the diff view.
The different sections of this readme will be moved to their official locations in a follow-up PR.
Update #1184