Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I couldn't seem to get this work until I used a Transfer Attribute node instead of your Capture Attribute node. It is VERY fiddly, but once the material slots are in the correct order, it seems to work as intended. It's going to take a lot more work than I hoped to ingest a new model, but I think I can build a workflow from this. Thanks a lot!
Ah, yes, I was finally able to transfer the material index! I wish I could mark two answers as what solved my issue. Your suggestion of using the transfer attribute node is what got me through, but the bulk of the solution I've ended up with came from Chris. Thanks so much for the help.
Okay, that looks interesting. I'd be a shame to scrap the node network I put together, but this might be the only way to do what I need. I'll play around with this and see what happens.
Initially, I was using the remesh modifier, but it doesn't have intuitive controls for getting the final output at a desired resolution. Currently, my tool creates a cube volume of equally distributed points and the input model selects which points in that volume spawn the blocks. If there's a way to use the remesh modifier so I could make sure the resulting mesh is, say, 32x32 blocks then I might reconsider this method.
It's a bit strange, really. There are a few main functions in my node network. Since I want the blocks to spawn in a perfect grid (as if it were a Minecraft structure), I first create a volume of vertices equally spaced apart. The input model, Suzanne, acts as a selection mask for those vertices in the volume to instance cubes on. The Suzanne model has two materials applied to it. I did this by going into edit mode and selecting the faces of the eyes and gave it a different material on slot 2. I'm looking for a way to transfer the material data for each individual cube instance that touches
Also, for some reason the instances won't take the material if it's not an existing object in the scene. My node network generates the cubes from a primitive Cube node and that completely breaks the material application.
Sorry, but this doesn't seem to work for my case. I can get a single material to transfer, but the second material doesn't apply to any of the instanced cubes. Does your monkey have multiple materials assigned to different faces?