Skip to content

Commit a125a1a

Browse files
mvaligurskyMartin Valigursky
andauthored
Added documentation example on accessing mesh instances of a render hierarchy (playcanvas#3465)
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent bd28154 commit a125a1a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/resources/container.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ class ContainerResource {
8888
* castShadows: true
8989
* });
9090
* app.root.addChild(entity);
91+
*
92+
* // find all render components containing mesh instances, and change blend mode on their materials
93+
* var renders = entity.findComponents("render");
94+
* renders.forEach(function (render) {
95+
* render.meshInstances.forEach(function (meshInstance) {
96+
* meshInstance.material.blendType = pc.BLEND_MULTIPLICATIVE;
97+
* meshInstance.material.update();
98+
* });
99+
* });
91100
* });
92101
*/
93102
instantiateRenderEntity(options) {

0 commit comments

Comments
 (0)