# Coloring imported 3dm objects in react-three-fiber

**URL:** <https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778>\
**Category:** Questions\
**Tags:** rhino3dmloader, react-three-fiber\
**Created:** [May 19, 2023, 8:50am UTC](https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778 "2023-05-19T08:50:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrispyDanger](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/crispydanger/32/35354_2.png) [@CrispyDanger](https://discourse.threejs.org/u/CrispyDanger)\
**Post date:** [May 19, 2023, 8:50am UTC](https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778/1 "2023-05-19T08:50:55Z")

</div>

Hello everyone! I`m a complete noob in react-three-fiber and three.js and I got stuck trying to color an imported rhino3dm object. Is there any way to do that?

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/f/9f1227c929a1fc770b47c78428dde1cece5b5877.png)  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [May 20, 2023, 8:36am UTC](https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778/2 "2023-05-20T08:36:58Z")

</div>

you do not need to wrap rhinodm into a mesh, that mesh will act as an empty group that’s all, it’s just this

```jsx
function Model({ color, ...props }) {
  const scene = useLoader(.......)
  useLayoutEffect(() => {
    scene.traverse(child => {
      if (child.isMesh) {
        child.material.color.set(color)
      }
    })
  }, [color])
  return <primitive object={scene} {...props} />
}

...

<Model color="hotpink" position={[1, 2, 3]} scale={2} />

```

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [May 20, 2023, 8:51am UTC](https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778/3 "2023-05-20T08:51:20Z")

</div>

here’s an example [Rhino3dmLoader in react-three-fiber (forked) - CodeSandbox](https://codesandbox.io/s/rhino3dmloader-in-react-three-fiber-forked-qsfvt?file=/src/index.js)

---

<div class="post-metadata">

**Author:** ![CrispyDanger](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/crispydanger/32/35354_2.png) [@CrispyDanger](https://discourse.threejs.org/u/CrispyDanger)\
**Post date:** [May 22, 2023, 9:05am UTC](https://discourse.threejs.org/t/coloring-imported-3dm-objects-in-react-three-fiber/51778/4 "2023-05-22T09:05:29Z")

</div>

Thank you!
