Importing .OBJ meshes no longer respects UV coordinates

Hello,

I am not sure when this started (within the last month or so), whenever I import OBJ meshes, the UV coordinates are no longer there. I believe they are defaulting to (0, 0), as when I apply the albedo texture, the mesh takes on the color of the top left pixel of the texture.

Here is the result of importing a crowbar model:

In a model editor:

Proof that UV coordinates exist within the OBJ file:

This issue holds true with any OBJ model, even ones I’ve imported into roblox in the past:

If I import to blender, and export as FBX, I can import without issue. I’ve tried exporting to OBJ from three different versions of blender, as well as a program called MisfitModel3D. All of these exporting methods previously worked in Roblox, but no longer do.

7 Likes

I can’t reproduce this with an OBJ from Blender 2.9. Do you have an OBJ file that consistently reproduces the problem?

Also what’s in that file that is making it 2.8 million bytes? That’s like 100x the file size I’d expect for the model I see in the screenshot.

And 40k UV coords? How many vertices? IIRC, there is a hard limit for a single mesh that will work in Roblox of roughly 32k verts.

1 Like

In the first screenshot, it’s a mesh that is made up of 13,000 triangles split up in to two groups.

kriss_sight.obj (192.3 KB)
Colt_Official_Police_Special.obj (801.3 KB)
uploads_files_994552_CrowBarObj.obj (2.7 MB)

All three of these obj files worked a few weeks ago when I imported them, now they don’t when I re-import. You can use any texture you already have uploaded to verify that the UVs are/are not working.

[EDIT] I should note that I am using the “Add Assets” option on the game explorer UI. This is not from setting the mesh id on a MeshPart via properties UI.

1 Like

It appears to be the mesh splitting that’s removing the UVs. If I reduce the crowbar to under 10k triangles, it’s fine, no matter which method I use to import it.

The warning you get that a simple shape mesh like this has >10k triangles should be taken as an indication that something is very wrong. This is not a game-ready asset. This crowbar has an insane number of coplanar triangles that are adding absolutely nothing to the detail, but making it have the performance cost of 20 crowbars. You can get the triangle count easily down to 1200 with no change in appearance, but even that is still a bit high for this kind of item. See if you can get it into the 400-600 triangle range.

Just to give you a point of reference, this is the highest-poly weapon in my game Frogge, a classic banjo. It’s a single MeshPart with SurfaceAppearance texture. 3,222 triangles total. I allowed this one high-poly item in the game because there’s only ever one in use. But most of the game’s axes and bats are under 1000 tris each.

Reduce everything as much as possible, and you won’t have all your players telling you your game “lags” :slight_smile:


6 Likes

Surely this cant be the case? The first mesh I linked is below 10,000 triangles, and also has the same issue. Additionally, weeks ago these meshes imported without issue. While the crowbar is greater than 10,000 triangles, it is pre-split into two meshes that are both under 10,000 triangles in my modeling program.

I don’t think the solution is to reduce triangle counts, as I am operating within the bounds that Roblox provides.

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

4 Likes

I am also having this issue, is there a workaround to getting the UV coordinates working properly in Studio?
I am concerned because I am unable to work on my project as of right now and I have not seen any responses/ updates about this issue.
Other Posts discussing this issue:

2 Likes

Hi, I took some time to investigate the issue and wanted to provide an update:

TLDR Section

Summary:

  • The issue only happens when the bulk importer needs to split an OBJ (by necessity when the file is too large, or by user choice if the “Import File As Single Mesh” option is not ticked)

Current immediate workarounds:

  • If you don’t need split meshes, tick the “Import File As Single Mesh” option and the UVs will import properly
  • Otherwise, I know this is not ideal, but the only thing I can suggest right now is to either export as FBX, or import your OBJ in blender/some other editor and re-export as FBX.

END TL:DR Section

The Problem

I started off by making a basic mesh and texture in blender and exporting them as OBJ together. I then imported the OBJ using both the bulk importer and the explorer tree view importer. I also exported the same file as FBX and imported that as well.
Screen Shot 2021-05-12 at 12.54.00 PM
As you can see, all 3 worked fine.

I then downloaded the meshes linked above (Kriss sights, colt, & crowbar) to test applying my crappy texture to them.

Importing via regular import worked fine, although as discussed above, the crowbar is too large for that import flow. (note this flow merges meshes by default, so mesh splitting is not possible)

Next I imported them using the bulk importer, once with mesh merging ticked and once without. Finally!! Reproduction!!

As you can see, the colt on the left (merging ON) has the texture properly applied, while the one on the right (split, see missing cylinder) has a blank texture; this is indeed what would happen if the UVs were all pointing to 0,0 (as theorised, and proved, in a different thread).

Finally I imported the OBJ into blender and re-exported it as FBX and then imported the FBX into studio with mesh splitting and got this result:

Both colts are split properly (missing cylinders) but the FBX (left) has the texture properly applied while the obj (right) does not.

I decided to really simplify the problem down and have 2 basic shapes a cube and a rectangle:
Screen Shot 2021-05-12 at 1.59.09 PM
As you can see, the issue persists; the unsplit (left most) has the texture applied while the split meshes (middle and right) don’t. So the issue really is with bulk importer splitting OBJ files into multiple meshes and does not involve mesh complexity (although mesh complexity may force the bulk importer to split meshes which will result in the issue appearing).

On Solving the Issue

So we know what part of the import flow is responsible… easy fix right? Unfortunately not so much, the bulk importer was built to work with the current mesh importer (i.e. merge mesh files by default). To make mesh splitting (and import of multi-mesh files as separate meshes) a possibility, it actually generates a temporary file for each separate mesh in the file you are importing and then feeds them one by one to our importer.

There likely is some issue when generating/importing these temporary files.

I will spend a some more time trying to figure out if these temporary files are the culprit and how it’s happening. I’ll report back when I get anything.

10 Likes

The Update

This issue is super weird. Here’s what I know:

On March 26th we upgraded the version of FBX SDK shipped with studio. The old version had a security vulnerability; hence why we updated and why we can’t just revert.

With the SDK update, something changed. For some reason, the temporary files exported by the bulk importer from an input OBJ lose UV coordinates when re-imported… I have no clue why. I spent a lot of time today and could not find a reason or solution.

Will we fix it?

Short answer: Yes, but not immediately.

The current import code is old, very difficult to work with, and has many issues (this one gets added to the list). It would be too much time and effort to fix this for now and my team has other priorities. Specifically, we are rewriting and revamping the whole mesh importing experience. I can’t go into many details, but we are working on a better, more efficient, mesh importing flow that will be built on top of new, healthier and better import code.

Our new architecture will tackle multi-mesh files properly by default instead of resorting to the temporary file shortcut that the bulk importer currently does, so the above issue won’t even have the opportunity to show up.

So what should I do with my meshes???

For now, unfortunately, if you want multi-mesh import you will need to get your mesh data into an FBX file. Most modern tools should offer FBX export by default.

Alternatively I was able to convert OBJs to FBX by importing them in blender (https://www.blender.org/) and exporting them as FBX. It’s annoying of course, but the only real solution I can provide for now.


We’re sorry this creates some short-term inconvenience, but we think you’re going to love the work we’re doing to improve our mesh workflows! I’ll make sure to update this thread when the beta becomes available.

11 Likes

Has this ever been fixed? it has been months and whole projects had to be stopped because of this

2 Likes

Hey there, sorry for the late reply. We’ve been working really hard on reworking the mesh import experience for a few months (as you pointed out); we’re finalizing the first version of the new importer and hoping to make it available for beta soon.

I promise I’ll update this thread when I have more info!

Edit: For the moment you should be able to get the UVs working by exporting as FBX rather than OBJ (or converting using blender / some other software).

4 Likes

There’s a problem where when you bulk import an FBX File, some of the meshes are appearing black without having a colour change or texture.

Is there any recent news to this? Last time I’ve checked it’s still been an issue.
as for using FBX, there’s still an issue with UVs

I’m no model/mesh-maker, but this has also been affecting some meshes in the Toolbox, mostly bigger ones. Sometimes a large portion of the UV mapping will be correct, but the rest won’t be.
This isn’t much of a hindrance but it’s further proof that imported meshes’ original UV mapping isn’t working as intended.

As far as I can tell, you cannot use OBJs that support groups of meshes. Instead you have to use export the meshes individually, but bulk importing it will work

The main issue is the Mesh Splitting on ROBLOX’s part. You can’t use any FBX or OBJ that use Groups.

*Edit: You can’t use FBX if you still want ROBLOX’s colour support on meshes.

Hey All, just wanted to post an update in case you missed the RDC keynote. Our CTO announced in his keynote that we are working on a brand new importer. See here (link has timestamp for the relevant section of the video): CTO Keynote Dan Sturman | RDC 2021 - YouTube

This is the project my team has been focused on and it fixes the issue in this thread (along with a ton of other problems our importers have). We’re working as hard as we can to get it into your hands as soon as we can. I’ll once again update when I have more info.

5 Likes

Thank you very much with the response of good news, I’m looking forward for the updates and bug fixes.

On another note, if anyone else that needs the UV Co-ordinates to work ASAP, there’s a blender PAID plug-in called ‘Capsule’ that Mass Exports every mesh object into individual .fbx, .obj. etc.

Here’s a video I found on the plugin, you’ll also find the store page for the plugin in it’s description. Capsule Addon for Blender: Batch Exporting Props - YouTube.

Works like before, just a lot more files.

*Quick Edit: I’ve tried to find some free plugins but there are currently none that I could find other than the one I’ve linked.

1 Like

FINALLY! The day has come.

My team has been diligently working for many months now on rewriting all of our import code from the ground up to give you the importer you deserve. It’s an early beta release so there are plenty of kinks to iron out and very likely a few bugs to fix. But the new and improved unified importer is available for beta. Check out the announcement post here: New Unified, Smart Mesh Importer Beta

I have personally checked with some of the OBJs in this thread and the UVs import properly.

Sorry this took so long, who knew building complex products took a long time!? I would absolutely love to get all of your feedback on how you would like us to improve this new importer moving forward.

Thank you for your patience and happy modeling!

10 Likes