Need help importing OBJ/FBX files with textures


https://forum.reallusion.com/Topic440523.aspx
Print Topic | Close Window

By mrl - 4 Years Ago

I’m having some issues importing 3D objects along with their textures into iclone. I’ve scoured the internet and the forums for days as well as doing all kinds of tests and I’m at a loss.

I’m trying to import 3D objects from sites like Turbosquid into iclone. From what I’ve read OBJ files with their accompanying textures are preferred to FBX files. When I download OBJ’s (with accompanying .mtl and texture images) or FBX files which include materials and import them into iclone, they are showing up without any textures/materials.

I’ve even edited the obj files to make sure they’re correctly pointing to their accompanying texture image files, but still get the same results. It seems like this must be a relatively simple process from what I’ve been reading on these forums. What am I missing?

Can anyone help?

By Kelleytoons - 4 Years Ago
Not that simple.  The good news is that relief is coming, in a later release of iClone.  For now you could use my Python routine (which will do the same thing):


By mrl - 4 Years Ago
Mike Kelley to the rescue once again!

Thanks for the reply. I followed the directions and so far I haven't been able to get it to work. When I export from 3DXchange into iclone and run your LMiCloney.py script, I get three messages returned in the console:

1. PIL isn't installed
2. 'object name'
3. done

I  know PIL is a python library and I installed it on my local windows python installation, but still get the PIL isn't installed error when I try to run the script from within iclone.  Any ideas?

Thanks again!
By Kelleytoons - 4 Years Ago
PIL has to be installed into the iCLONE Python library, not your Windows one (they are completely separate).  There are tutorials out there on doing this, both in iClone help and I think even I have a tutorial online about this (look in my channel -- I'm pretty sure it's there).

That said, that may not be the entire problem.  But first get it installed properly and then let's see what your results are.
By Kelleytoons - 4 Years Ago
By mrl - 4 Years Ago
Thanks Mike! I've succesfully gotten the package installed.  It's not working, but I'm going to go through the other video tutorial again and make sure I'm doing everything correctly. I'll report back as soon as I've done it.
By Kelleytoons - 4 Years Ago
Okay, a screen shot of the Python report as well as perhaps your folder of textures will help me figure out what's going on.
By mrl - 4 Years Ago

I think I’m stuck on the very first step. I’ve tried multiple .obj files both from turbosquid and cgtrader (along with their accompanying .mtl file and texture images), and when I import the obj into3DXchange or iClone, the 3D objects themselves show up, but none of the textures and materials. I notice in your video, your project in 3DXchange already has the materials and textures applied to the model.

Here’s my folder:

https://forum.reallusion.com/uploads/images/4d117663-4914-4b0c-bbb8-9df9.jpg

Here’s the obj file in 3DXchange:

 https://forum.reallusion.com/uploads/images/816888c4-7d31-49ec-bf20-8be9.jpg

This is the same obj file I’ve sent to iClone:

 https://forum.reallusion.com/uploads/images/d2a7c049-e2e5-4850-8f95-77ef.jpg

And finally, here’s the console log when I run the python script:

https://forum.reallusion.com/uploads/images/b037289d-30c2-4cdd-b686-c2e1.jpg


I've also uploaded the files I'm using in case you want to check them out:

Export folder files Google Drive link

Thanks!

By Kelleytoons - 4 Years Ago
If those are the ONLY textures for those models (I see a sub-folder of "Textures" so I don't know what's in there) then there IS no auto process to put textures on.  Nothing will help -- you'll just have to do it all yourself.

Unfortunately, there are no standards when it comes to putting textures on objects.  Folks use such different names for things that if they don't follow any sort of "normal" process there is no auto way to figure it out.  Inside the MTL file there should be the diffuse textures at least, so you can examine that yourself (it's an ASCII file).  But I'm afraid you're mostly out of luck.

(My routines -- and the routines copied from it in CC and soon in iClone -- are based on logical naming such as Daz devs use.  Most folks who give away models don't do any such thing.  You do get what you pay for).
By mrl - 4 Years Ago
That explains it! Thank you.  Is there any way to know by looking at the files whether or not they're setup properly? Is there a particular naming convention or something like that, or is the only way to know to try opening it?
By Kelleytoons - 4 Years Ago
You can pretty much tell yourself -- for example, let's take a hat.  It might have two textures, one for the hat, the other for the ribbon around it (like a felt hat).  So you'd see the diffuse as hat_diffuse.png, and the other textures for it as hat_roughness.png, hat_metallic.png (might not have that) and hat_normal.png.  Sometimes the words are slightly different (normals instead of normal), sometimes letters are used (hat_d.png for diffuse, hat_n.png for normals) but essentially you can look at them and they share a common first name root with the extension describing the actual map purpose.

But you will rarely find any of this in free stuff -- if you buy stuff from Renderosity or Daz they will nearly always have a naming convention (although some of the conventions are, let us say, somewhat unconventional).  Folks who do things for free could care less -- they really don't care about you per se.  So it really is a matter of you get what you pay for.
By animagic - 4 Years Ago
One problem is that the .mtl file, which is supposed to specify which textures to put where on the OBJ file contains none of that information.

I have imported OBJ and FBX files and they did get their textures so it seems that the texture mapping information is lacking. 
By mrl - 4 Years Ago

Thank you both for the information. Very helpful!

Now that I realize the issue lies in the way these particular models were created and packaged, I’m left with different questions.Perhaps I’m still not fully understanding all of this, but my hope was I would be able to go on various sites and purchase all of the models I needed for my projects (primarily locations house interiors and exteriors, etc.)

I’ve been successful importing assets from the DAZ store and the Reallusion store in the past, but feel the selection is pretty limited. I was hoping some of the larger sites selling 3D objects (like Turbosquid, CGTrader,etc.) would be good resources for me to draw from for paid assets. This brings up some questions for me. For example, here’s a model I was considering for the project I’m working on:

https://www.cgtrader.com/3d-models/interior/bedroom/bedroom-45afde3d-826d-4402-b15d-d68c53fe4780

It does say that it is available as an obj/mtl or an FBX file download. My questions are:

  1.  Is there any way to be sure this will have the files in the right format before buying it?

  2.  Do most people who buy these models go through the laborious process of reassigning all the materials and textures manually or is there a part of the process that I’m missing (or that’s missing in reallusion tools), that most 3D artists use to streamline this when using pre-made assets?

  3.  If the obj/mtl files were not conformed properly to auto-assign the materials, is the only option the time-consuming process of manually assigning them to every single object in the scene one-by-one?

I’m suspecting there’s still something I’m not fully understanding, as I can’t imagine most of the people who buy all these pre-built assets are taking the time to manually connect all the materials and textures every time they buy something (at least I sure hope not!)

Thanks again for the help.

By Kelleytoons - 4 Years Ago
Most people DO reassign textures -- and it's seldom even as easy as THAT sounds.

Look -- for one thing no model maker can assume what shader you will be using.  I assume you don't understand shaders, but let me give you the Reader's Digest version -- a material is only as good as the maps assigned and how they are rendered.  And every shader needs different kinds of maps and different ways to process them.  iClone uses PBR and some other things use that as well, but it's not the only shader out there nor is it even the only shader inside of iClone.

So you couldn't expert a developer to develop shaders and materials for every single program you could use -- would never happen.  Daz and RL stuff works well in CC3 because 1) RL developed routines which translate Daz textures into the PBR model and 2) Devs wrote materials directly for iClone.  Those (and Rendersosity, who makes stuff that's *mostly* Daz compatible) are the only easy models to use.  Everything else you need to gain experience in texturing yourself.

That's not horrible -- most stuff rarely uses hundreds of textures, and learning how to adjust and texture something is a skill like anything else.  If you are going to buy assets and use them in whatever program then you had better either buy them that are made for that program or learn how to texture.  It's one of the other.  There's no such thing as a free lunch.
By 4u2ges - 4 Years Ago
Do not waste your money unless you have 3ds MAX and you are an expert in modeling (which I suspect you do not).
Those pretty looking renders are taken in MAX. You are not going to get that in iClone even if you'd be able to import it (regardless whether you get it for free or you pay for it).
Reason is, that most of the time export assets (FBX/OBJ/3DS) they supply are done wrong. Broken geometry, broken texture links, no UV maps. Not to mention whooping poly count.
FBX size of that bedroom is 241 MB, which tells me the poly count would be no less than a few millions. And no UV mapping?

So stay away from CGtrader and Co. unless you need some simple props, which you can afford to spend some time with geometry and texture and UVs...
But again you still need to have some modeling skills and free Blender is your best friend.




By animagic - 4 Years Ago
I think you have to split up your needs. The model you show has an interior plus a whole bunch of clothing and as 4u2ges mentioned, the polycount will be enormous, which will make it very slow in iClone.

Unless you do architectural previz, which are pretty stills, your purpose is to tell a story with animation. Think in terms of film sets: you only need what is seen by the camera.

There are interiors in the Market Place that would be a good start (DAZ also, Mike knows more about that). There is even the free loft project that comes with iClone. Think of it as location scouting: it may not be exactly what you have in mind, but it will be good enough.
By Amper Sand - 4 Years Ago
@mrl
Since @4u2ges mentioned CGtrader: as one who bought from there, one practical advice - before you buy, apart from scrolling down to look at poly count, UV map and so on, ask the developer if his product is suitable for you, some of them are even familiar with iClone. Everytime I've asked them they responded, helpful, quite a pleasant surprise but, bottom line, their interest is to sell their product.

Later edit: and always check first if what you need is not already available in Reallusion Content Store or Marketplace, ie fully compatible with iClone and/or Character Creator.
By mrl - 4 Years Ago
Thanks to everyone for all of the helpful and insightful responses. Not was I was hoping to find out, but I now feel like I have a much clearer (and more realistic) idea of what the situation is, so I can at least move forward and plan accordingly.

Again, very much indebted to all of you who took the time to respond. Very grateful for this community.
By Kelleytoons - 4 Years Ago
And don't get too discouraged.  You can get some *quite* beautiful stuff with little effort (I was just grabbing a scene at random but here is "Streets of Asia" from Stonemason and there are literally hundreds of textures in place here, all handled automagically by either my Python routine or by CC3/Transformer (I forgot which I used but they work the same since it's mostly the same code).  The only thing I did was adjust the water slightly so basically a five minute import:

https://forum.reallusion.com/uploads/images/d011053e-2657-45d9-934d-bc8f.png
By mrl - 4 Years Ago
That's really good to hear. Thank you, Mike!
By Kelleytoons - 4 Years Ago
Yeah, stick with Daz and the RL marketplace (or RL themselves) and you'll be fine.  Between the two you ought to be able to find nearly anything (and if there's something specific you're looking for, just ask here -- members can point you to the right directions).