# What is the correct way to serialize data for rpc in grasshopper

**URL:** <https://forum.compas-framework.org/t/what-is-the-correct-way-to-serialize-data-for-rpc-in-grasshopper/640>\
**Category:** compas\_rhino\
**Created:** [November 21, 2022, 5:19pm UTC](https://forum.compas-framework.org/t/what-is-the-correct-way-to-serialize-data-for-rpc-in-grasshopper/640 "2022-11-21T17:19:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfeihl](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@nfeihl](https://forum.compas-framework.org/u/nfeihl)\
**Post date:** [November 21, 2022, 5:19pm UTC](https://forum.compas-framework.org/t/what-is-the-correct-way-to-serialize-data-for-rpc-in-grasshopper/640/1 "2022-11-21T17:19:05Z")

</div>

Hello,

I’m running into a seemingly simple problem where I am unable to pass a compas mesh to an rpc proxy:  
In grasshopper, I need to convert a compas mesh to a trimesh datastructure ([trimsh](https://trimsh.org/trimesh.html)) but it fails in a cryptic way (Fault, see screenshot).

![image](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/9231542d13e794931abc55fbacd2fc945fdd108f.png)

It looks similar (at least on the surface) to ['Fault' in rpc call](https://forum.compas-framework.org/t/fault-in-rpc-call/637)

The rpc works (I can call functions as long as it takes simple arguments (python base types), but can’t pass any compas objects.

What am I missing for the correct serialization of a compas mesh?

Thanks in advance!

Nicolas

(PS: compas version 1.17.0, Rhino 7 SR 24)

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [November 21, 2022, 7:48pm UTC](https://forum.compas-framework.org/t/what-is-the-correct-way-to-serialize-data-for-rpc-in-grasshopper/640/2 "2022-11-21T19:48:12Z")

</div>

what is the type of the return value of `schema.shapes.mesh_compas_to_trimesh`?

---

<div class="post-metadata">

**Author:** ![nfeihl](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@nfeihl](https://forum.compas-framework.org/u/nfeihl)\
**Post date:** [November 22, 2022, 8:39am UTC](https://forum.compas-framework.org/t/what-is-the-correct-way-to-serialize-data-for-rpc-in-grasshopper/640/3 "2022-11-22T08:39:50Z")

</div>

💡 thanks! rooky mistake…  
Not that it is clearly stated in the [docs](https://compas.dev/compas/latest/tutorial/rpc.html#supported-data-types-1) that you need to both serialize **and de-serialize** …
