-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
P8 NGE linear and radial cloner blocks #14172
P8 NGE linear and radial cloner blocks #14172
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Why not cloning with vertexData.clone and then applying the correct transformations on each clone? something like that:
where matrix is the overall transformation build from the parameters you have on the block |
I had no clue you could do this, will have to refactor it to use that. |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/14172/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/14172/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/14172/merge#BCU1XR#0 |
Ok I feel like we need a general clone as well. Something that takes a geometry, a count, a rotation/scaling/translation and simply instantiate the geometry n times. The inputs (geometry and transformation can be static or dynamic if for instance we create a new CloneID value that will give you the current index (from 0 to count). I will add this node after we have merged this PR :) |
@Pryme8 just for naming my block will be CloneBlock so maybe we can name yours LinearCloneBlock and RadialCloneBlock? |
@Pryme8 any update buddy? |
I totally spaced out about these, my bad. Ill try go resolve this stuff today or tomorrow! |
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.
Everything is fine. We simply need to look at the way InstantiateBlock operates and do the same.
@deltakosh should be good to go now! |
Thanks!! |
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.
Ok sorry to be a pain :)
Here is my idea: as these 2 classes are almost a clone of InstantiateBlock, what if we simply inherits from it and replace the '_buildBlock' function?
Also @PatrickRyanMS, regarding naming, maybe we should name then like LinearInstantiateBlock and RadialInstantiateBlock?
I would suggest we follow the same format we've already established with the word "instantiate" first so that all nodes in the instances group begin with "instantiate." So instantiateLinear and instantiateRadial. I would also suggest to order them in the node list right beneath instantiate in alpha order:
|
Ok, if I get a chance tonight ill fix that up. If not then it will have to be tomorrow while I'm off work! |
Finally was able to get to this, sorry about the delay. |
… p8-nge-linear-cloner-block
its yelling at me about the linting but when I do npm run lint it only brings up warnings about js docs? |
cc @RaananW for the lint/format issue. |
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.
this is the formatting issue
packages/tools/nodeGeometryEditor/src/components/nodeList/nodeListComponent.tsx
Outdated
Show resolved
Hide resolved
…ListComponent.tsx Co-authored-by: Raanan Weber <raananw+github@gmail.com>
Is it time to roll the beautiful bean footage? |
packages/dev/core/src/Meshes/Node/Blocks/Instances/instantiateLinearBlock.ts
Show resolved
Hide resolved
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.
Almost there ;)
Thanks a ton @Pryme8 !!! |
https://forum.babylonjs.com/t/nge-linear-cloner/43369
Just a simple linear cloner.
Only supports uv0 right now.
Probably should add color support as well.