How to assign materials to glb/gltf files that are rigged in Blender #1517
Unanswered
MinyoungNa1997
asked this question in
Q&A
Replies: 2 comments
-
I believe something like this should work. Can test with a fiddle if you could share the model. nodes.YourSkinnedMesh.material.color = new Color(0xff0000)
nodes.YourSkinnedMesh.material.map = useTexture(textureUrl)
return <group>
<primitive key="armature" object={nodes.ArmatureNodeName} />
<primitive key="mesh" object={nodes.YourSkinnedMesh} />
</group> |
Beta Was this translation helpful? Give feedback.
0 replies
-
gltfjsx was practically made for this: https://github.com/pmndrs/gltfjsx watch the short video, it explains it better than words can: https://twitter.com/0xca0a/status/1341811710081044483 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have already posted an article for discussion on drei,
but I thought it would be appropriate to post the question here as well
I have this cool figure that I made in blender and added materials to.
The code is fairly simple, at least just for the uploading part
The issue I was having was that, there was no easy way to assign custom material using
THREE.RawShaderMaterial
. The shaders you see now are assigned through blender.I tried altering materials from
const { material } = useGLTF('/glb/Victory.gltf')
, but the new material was applied to anunrigged version of the model. As far as I know,
nodes
are composed of SkinnedMesh and Skeleton, and skeletons aren't meshes, so I can't change their material.Is there any way to alter the material of a rigged mesh?
Beta Was this translation helpful? Give feedback.
All reactions