Sunday, May 17, 2020

SculptrVR to Roblox Workflow

SculptrVR is a fun, free-form VR sculpture program.  After my son made a cool design in the app, I extracted the .obj mesh from the Oculus Quest (see this post for all the details).  Besides 3D printing it, I also wanted to be able to bring it into a Roblox level so he can play on it.

A few things I learned about this process:

First, you need an "adult" Roblox account to make "mesh objects" in Roblox Studio.  I guess they are afraid of the kinds of meshes kids might upload?  Weird.

Second, you can import .obj files into Roblox Studio, but I suggest the following workflow in Mesh Lab to do some processing on the mesh so it works well in Roblox Studio.

1) Load the .obj file into MeshLab

2) Roblox Studio has a limit of 10,000 faces on MeshParts:



So if you have more than 10,000 faces in your mesh, in MeshLab use "Filters/Remeshing, Simplification and Reconstruction/Simplification: Quadratic Edge Collapse Decimation" to reduce the number of faces:



You can target for 10,000 faces, but if you end up with more faces than 10,000 after the decimation, you may need to set a slightly lower target like 9,900:



3) SculptrVR exports .obj meshes with vertex colors.  However, Roblox Studio expects a mesh to have a texture image file instead.  So you need to create the texture file from the .obj file you obtained from SculptrVR.  There are two steps to do this.  First use "Filters/Texture/Parameterization: Trivial Per-Triangle":



What is "Parameterization"?  It maps the space of the 3D triangular mesh onto a flat, 2D surface.  The best explanation I've seen is from this slide from a Tel Aviv University presentation:



4) Now that there is a mapping from the triangular mesh to 2D, we need to carry the vertex colors to the 2D texture.  Use "Filters/Texture/Transfer: Vertex Color to Texture":



You must then name the texture file:



The texture file is a .png. It will look like a lot of colored triangles:



5) Now export the processed .obj file from Mesh Lab, and make sure that it references the texture file:





6) Now go into Roblox Studio.  Right click or Command-I to insert an Object:



And insert a "MeshPart":



Select the generic MeshPart you inserted



Then go to the Properties/MeshId and choose the .obj file you exported from MeshLab:



You will get a couple of warnings, you can choose to say yes or no:

 

And at the end of that, Roblox Studio should import your .obj mesh and automatically load up the texture file as well:




There you go!



Saturday, May 16, 2020

SculptrVR to 3D Print Workflow

SculptrVR is a free-form 3D sculpting app for multiple VR platforms, including Oculus Quest, which I have.

My son made a cool sculpture in SculptrVR, and I decided it would be neat to 3D print it.  Here is what he made, photographed from within the app:



To save a mesh in SculptrVR, go to your palette and click on the file folder icon (see red arrow):



Hit "Save":



Then click on "Export Mesh":



When the export is done, you'll see this:



As the instructions say, you'll need to reboot your Quest.  With your headset on, hold the power button your headset down until you're prompted with a shut-down screen.  Select Restart to reboot your Oculus Quest.

Now you need to hook up to the Oculus Quest with a USB-C data cable.  If you are like me and stuck with a USB-A laptop, I recommend the Juiced Systems USB-C to USB-A 10 Gbps USB 3.2 Gen 2 Data Power Cable. That one worked for me.  If you have a Mac, you will need to download the Android File Transfer app.  When you connect to the Quest, you will see a file directory like this one:



Go into com.sculptrvrinc.sculptrvrapp/files/OBJExports, and your exported .obj mesh will be there.  Transfer it over to your computer.  At this point, you can look at it with MeshLab:



Also you can load it into Ultimaker Cura.  Many meshes from SculptrVR are unlikely to be "manifold", but that doesn't seem to matter much in slicing and printing.



Then just slice, and print...