apply texture on OBJ files automatically in batchmode - unity3d

I have created a C# script to create unity3D asset bundles automatically via batch mode. When I import FBX files and export them as asset bundles, on instantiation in the app at runtime the textures of FBX files are applied automatically; if while exporting, textures are in same folder and if the texture filename is not changed. But OBJ files never take the textures automatically. OBJ files are exported and also instantiated at runtime in the app but without textures, with the same batch mode script that I use for FBX.
It is important for my project that textures are automatically applied on OBJ files also. How do I do it?
I am using Unity 4.5.0 on a mac.
Thanks!

Found the solution! Two files are generated when object file is exported from 3D modelling software, one is the .OBJ and other is .MTL. The latter contains texture map information of that particular object file.
If .MTL file is imported along with the .OBJ and textures in the unity project, while exporting asset bundle, unity takes all the textures automatically. When this asset is rendered in the app, all the textures are applied automatically now.

Related

Importing an .dae into Unity from blender with referenced textures

The issue that I'm running into revolves around 3 programs: 3DCoat, Blender, and Unity.
With 3DCoat, I export textured .obj files with their corresponding .png texture sets (textures designed for Unity). Within blender, I'll import the .obj file to convert it into a .dae file while adding additional data without altering the geometry of the object (adding points of articulation, centering, etc.). From there, I'll take the .dae and import it into Unity.
The issue comes about with the textures. From 3DCoat to blender, the .obj files reference 3 textures: the normal, the height, and the albedo. When the files are being converted to their .dae forms, some of them retain the information of referencing all 3 textures, some only reference the albedo, and a select few reference none at all. Within Blender 2.79b, I've no way of looking to see if the normal maps or height maps are being referenced unless if I export the .dae file into a completely empty folder in which the referenced textures will have a copy created in there alongside the .dae. The issue, from what I can tell, either comes from 3DCoat not referencing the textures all the time, or from blender removing references.
The reason that I'm trying to reference as opposed to just using the Materials system within Unity is by direction of higher-up co-workers of mine. That, and supposedly it saves some space within the installer.
Essentially, is there any way to fix the issue within blender, or consistently guarantee that an exported .dae will have the referenced textures?

Convert .unity scene files to YAML without touching prefabs

Is there any utility out there that will convert a .unity scene file to YAML without affecting the rest of the prefabs and assets? I've found instructions to change the Asset Serialization in the editor, but it affects all assets, where I would like to only do our scene files. (Our project has a large number of files and converting them all is too much risk at this point in the project.)
For as far as I know, there is no selective serialization option. If you serialize to text (YAML in this case), that will happen for all of Unity's internal asset types (scenes, prefabs, scriptable objects, etc.). Of course this does not apply to any of the external assets.
Make a copy of your project, switch serialization to text. Copy the reserialized yaml scene file back into your main project, where you set the serialization to mixed.

How to export fbx with textures from Unity?

I have downloaded a Unity asset which included lots of 3d models with textures/materials etc.
I wanted to share one of those objects with an artist, so that they can create a new model on top of that model, so I exported the fbx from Unity using one of the Unity fbx exporter assets.
However, the model was exported without any textures and so it looked pretty much white as a whole. Therefore, the artist cannot really work on a model that includes textures and also send me back the finished work with those textures.
I am wondering, is there a way to actually export everything with the fbx
from Unity ? Thanks !
Assign your material in the source package, make sure there is a baked texture in the diffuse slot
Assign your other baked textures to the spec, normal and others
Check embed textures at export
Check 'import materials: by material name' is selected for your imported model (in the inspector)
Where possible use a portable file format like FBX and follow these guidelines.
http://forum.unity3d.com/threads/material-texture-faq.244786/ http://unity3d.com/support/documentation/Manual/HOWTO-exportFBX.html

How to import a .obj with a .mlt into Maya?

I have a folder with a .obj file, a .mlt file, and a number of .jpgs that are textures for the .obj file. Here's a link to the folder.
I'm trying to import this .obj into either Maya or Unity 3D, and when I do I only see a gray, untextured object. How can I get my model to appear with the textures/materials in the folder? From what I gather from elsewhere on the web, .mlt files are sort of tricky to work with in combination with .objs, but is there anything I can do here that will let me get this model to render properly with these materials in Maya or Unity 3D?
Grateful for any help.
From what I've seen online as well, Maya doesn't play nice with .mlt files. I think the best solution is to grab a copy of Maya LT (or download the trial), open your .obj w/ .mlt, and use the FBX plugin (built-in) to export a .fbx file which is compatible with both Maya and Unity.

Unity 3D importing

I used to code in c# using Xna then I saw Unity 3D engine and I downloaded latest version installed correctly started development of my game but suddenly when I was importing my animated character Unity 3d blocked my pc ! I noticed that my keyboard goes off when that happened and I cant move arrow or call task menager I can only restart pc ! So brother and sisters help me on my way .
Model files that are placed in the Assets folder in your Unity project are automatically imported and stored as Unity assets.
A model file may contain a 3D model, such as a character, a building, or a piece of furniture. The model is imported as multiple assets. In the Project view the main imported object is a Model Prefab. Usually there are also up to several Mesh objects that are referenced by the Model Prefab.
A model file may also contain animation data which can be used to animate this model or other models. The animation data is imported as one or more Animation Clips.
What I understand in your question is that whenever you try to import assets into unity it makes trouble.
Try to place them in the folder in your drive and then run the project in Unity.
The normal path of Unity project is C:\Users\Public\Documents\Unity Projects
From what I understand; Your computer is spazzing out when you're trying to import Animated 3D characters into Unity 3D
I have faced a similar problem.
The solution I believe might work is :
Create the appropriate folders inside of unity. Assets > Models
Outside of unity, place the OBJ file for the models into your c:\Users\Public\Documents\Unity Projects\Your Project or wherever it might be, in the Assets\Models folder.
Then when you're inside unity, it should be in there without any issues.
That should do the trick.