Check if a .OBJ file is updated and import it back to Rhino

Hi guys,
I’m writing a python code which helps me communicate with an external software called RizomUV. I successfully made a GUI with a button that exports the mesh in the Windows tmp folder and than opens it with RizomUV.

image

When, into RizomUV, I save and overwrite the file I want to check if this .OBJ is changed and update the mesh in Rhino, like Block Instances do.

Is it possible?
Thanks for help

I’m not aware of Rhino having anything built-in to help with this.

I’m also not sure how much detail you are looking for, but the high-level options I’d investigate are:

If you want event driven updates, then I’d look at:

A more manual approach would be to use Python’s os.stat to compare modified times.

One could also just read the file and compare lines, but that could take a while for larger files.

Next you will need to update the mesh’s texture coordinates after reading them from the obj file:

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_Collections_MeshTextureCoordinateList.htm

I guess another approach would be to make a new mesh. Rhino has an obj reader:

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_FileIO_FileObj.htm

Then the user could delete the old one or keep it for reference or something.

Thanks for your help!
I will try this approaches and let you know!

Thanks again

@Julio Hi Julio,
Can you share the rhino bridge to RizomUV?

thanks

Hi,
you can download it from here:
https://origamidigital.com/cart/index.php?route=product/category&path=59_61

wow, thanks for your help
great job