So I have an OBJ 3D model with its associated MTL file. The MTL file contains all the textures. However, when I convert the file to the USDZ format, the textures are not attributed to the file. This is the code I use.
xcrun usdz_converter /Users/SaiKambampati/Downloads/Models/object.obj /Users/SaiKambampati/Downloads/Models/object.usdz
The USDZ file is created but the attributes and textures are not applied. Is there any way to include the MTL file when converting the OBJ model to USDZ model?
To convert OBJ to USDZ, I'd recommend using GLB as an intermediate format.
You can convert OBJ to GLB using Blender, by importing the OBJ, and exporting as GLB.
Then Spase has a GLB to USDZ converter available at https://spase.io/converter, that rapidly does the conversion (for free), powered by a Google USDZ library. It's a drag-and-drop tool, and after conversion the USDZ can be downloaded instantly.
For what it is worth, I created a model in Blender intended for usdz and used regular Texture and UV mapping to color it. When I output the OBJ I too got a .mtl file but did not need it. When I passed the texture .png to usdz_converter as the color_map param the texture showed up in Quick Look on iOS 12.
Xcode's Command Line Converter for USDZ doesn't understand associated material MTL files for OBJ 3D models at the moment.
For texturing converted USDZ models in Xcode 10/11/12/13 you, firstly, need to save UV-mapped textures in Autodesk Maya as JPEG or PNG files (for OBJ, ABC, FBX, USD or DAE models) and then assign this UV textures in Xcode. Or, you can use Maya 2020 / 2022 USD Plug-in to generate a USDZ model with textures.
For further details read about Pixar USD File Format HERE.
Related
In the WWDC 2015 fox demo, there is a SCN file representing the 3D fox. If you want to incorporate the fox in a different app, you import the fox's SCN file and its texture maps.
But if you have 3D characters made in an authoring program like Cinema 4D (https://www.maxon.net/en/products/cinema-4d/overview/), how do you generate similar SCN files for the different characters? Cinema4D cannot export SCN files like this so what do you do?
And does the process change if the characters are animated?
I'm using C4D r12, I imagine the process should be the same for later releases.
One option is to create a separate file for each character. Pay attention to the organization in the Object Manager: the hierarchy of objects as listed there will be the scene graph of nodes in your imported scene file. This includes nulls which will end up as container nodes in SceneKit. The names of your objects and nulls in C4D will be the names of the SCNNodes in the scene file. When you have this set up as desired, save via File > Export... > COLLADA(*.dae)
Alternatively, you could create all your characters with one file and then parse them in SceneKit using the unique name of that character's container node (previously a "container" null in C4D).
Xcode supports collada (dae) files. You can import them into your assets folder and convert them to .scn files. Or Xcode will automatically convert them when you compile your app.
Collada files can also contain animation data, and can be exported from most 3D authoring programs.
Is there any way to generate a 16-bits per channel(RGBA) PNG file using D3DX11SaveTextureToFile?
Or any version of DirectX, any image library(C++), any image format
I tried to use the sample code here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205131(v=vs.85).aspx
and modified the function names to D3D11 version.
The program works perfectly when I set the desc.Format to DXGI_FORMAT_R8G8B8A8_UNORM .
But the D3DX11SaveTextureToFile returns E_FAIL when I changed the desc.Format to DXGI_FORMAT_R16G16B16A16_UNORM .
I've tried to use DevIL (developer's image library) but it doesn't support 16-bits per channel png file.
The only format which can save all texture-formats is D3DX11_IFF_DDS. It seems that D3DX11SaveTextureToFile can't save 16Bit pngs. One possibility is to extract the imagedata of your texture and save it manually with one of the possibilities (e.g. OpenCV or libpng) discussed here: Writing 16 bit uncompressed image using OpenCV.
I bought a model from TurboSquid in 3DS format and am trying to load it into an XNA project.
I've exported to FBX and turned ON the "Tangents and Binormals" export options.
If I do not set basicEffect.TexturesEnabled, it renders but without textures. If I turn on TexturesEnabled, though, I have problems:
If I turn off "Generate Tangent Frames" in the content processor, I get "The current vertex declaration does not include all the elements required by the current vertex shader. TextureCoordinate0 is missing." at runtime.
If I turn on "Generate Tangent Frames" in the content processor, I get "Required Vertex Channel TextureCoordinate0 no found" at build time.
So, the question is how to take a model in 3DS, export it so I can use it as an FBX model in XNA and get all of the UV mapping and normals correct. Even the VS2012 FBX preview can render it properly, so it seems like it should have all it needs, but no.
This can be a number of things. If the model was using a 3rd party plugin or materials other than standard, this will cause the UVs not to align.
My suggestion is to make sure that the materials are in a standard format
Ungroup the entire model if necessary.
lastly,
If the model is not rigged, make sure it's an editable poly.
From there you can try and export the model again. Are there any other formats that XNA can import?
If this doesn't help, please go to Support.TurboSquid.com and create a support ticket. We can try our best to help.
Christopher Briere
TurboSquid Product Support
I am using Metaio's Creator to create an AR event and using a model the client purchased from TurboSquid.com. Everytime I try to convert the .3DS file to an .MD2 file I get an error that there are to many polygons.
Is there a program that can automatically convert the .3DS or .OBJ to an .MD2 without lowering the polygon count or automatically taking polygons out without risking the integrity of the model?
MD2 only supports 4096 polygons inherently. As #0r10n said, you have to reduce the number of polygons to make it working with MD2. For conversion, I had the best experience using the QTip plugin for 3Ds Max here: http://qtipplugin.com/
Very easy to use and very powerful.
If the model has too many polygons you can import it into a 3DCC-tool like Max, Maya or Blender and use their tools to reduce the polygon-count.
For example using Blender 2.49 you can use the PolyReducer-Script, that preserves UV-Coordinates.
How to export .3ds file for using RenderMonkey from 3dsMax 2010?
When I look into Stream Mapping in RenderMonkey,
there are POSITION, NORMAL, TEXCOORD, TANGENT, BINORMAL, TESSFACTOR etc.
I want to know how that information export for sending vertex shader as streaming data.
Thanks in advance.
Which streams do you want/need? A 3ds usually contains POSITION, NORMAL, and TEXCOORD. If you export from 3DSMax to an OBJ then you have more control over exactly what gets exported. TANGENT and BINORMAL are used for shaders such as bump-mapping and are generated by RenderMonkey. I don't know how to use TESSFACTOR. Just make sure that your VS input struct uses the correct semantic (pink text in rendermonkey) for each input stream and RM will populate them appropriately.
You can use DirectX Exporter for 3ds Max to export your scenes to a x file which contains texcoords, normal and binormal. The latest release can even convert a standard material with multiple UV coordinates to a DirectX material(.fx) and generate shader code such as tangent-space normal mapping.