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

Implement basic support for adding maps to SCNMaterial #121

Merged
merged 14 commits into from
Dec 7, 2017

Conversation

bnjm
Copy link
Contributor

@bnjm bnjm commented Dec 5, 2017

This PR allows for materials to set with maps like-

material={{ diffuse: { path: 'local/uri.png', intensity: 0.5 }}}

@bnjm bnjm changed the title WIP: Implement basic support for adding maps to SCNMaterial Implement basic support for adding maps to SCNMaterial Dec 5, 2017
Copy link
Collaborator

@macrozone macrozone left a comment

Choose a reason for hiding this comment

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

can you do some renaming?

@@ -69,20 +69,19 @@ export default (mountConfig, propTypes = {}, nonUpdateablePropKeys = []) => {
// any custom props (material, shape, ...)
const nonNodePropKeys = keys(propTypes);

const processColors = props => ({
const parseMaterials = props => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a file called "parseMaterial", but exported functions have completly different names.

But here you have function "parseMaterials". I know it was already confusing to begin with, but maybe we can improve here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it to processMaterial to match the processColor function we are already using

},
}),
material,
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • it took my a while to get that. Can you rename the variables? Also maybe an approach without reduce would be more easy to understand. maybe with mapValues from lodash?
  • also a comment about why we support diffuse to be a string.
  • instead of typeof you can use isString(prevMaterial[property])

@macrozone macrozone merged commit d5de1b1 into react-native-ar:master Dec 7, 2017
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.

None yet

2 participants