News:

 

Topic: defoult material on import  (Read 2892 times)

0 Members and 1 Guest are viewing this topic.

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
August 21, 2014, 08:17:06 am
Why when I import obj it not get defoult material? It just white, how to automaticly assign defoult material to imported objects?
Portfolio: www.samardac.com

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
August 21, 2014, 10:35:48 am
Pleas help!
Portfolio: www.samardac.com

  • No avatar
  • Posts: 130
  • Spline
August 22, 2014, 09:09:37 am
I wish I could answer your question... but really, I'm also just wondering if this can be done in NVil yet?  If not, I second the request.  Oddly, I feel as if some of the objects I've brought over from ZBrush through the GoNVil script have occasionally been imported with the default material applied (unless the object was poly painted white in ZBrush, which I usually do)... but maybe that's just my imagination since I just now tried bringing over an unpainted mesh from ZBrush and the default material was NOT applied.  Either way, this would be handy.

  • No avatar
  • Posts: 3711
  • Developer
  • Administrator
  • Polygon
August 26, 2014, 08:38:53 am
The problem could be in your obj file. Please send me a sample obj file with just one simple box. Also together with its mtl file which is a material file that goes with the obj file.

  • No avatar
  • Posts: 130
  • Spline
August 26, 2014, 09:38:57 am
I found out what the problem is, at least in my case.  If an .obj is opened in NVIL, and it *contains a UV map*, then the default Nvil material is applied.  If an .obj is opened in NVIL, and it *does NOT contain a UV map*, then Nvil applies a pure white "material".  Here is a link to download an example of each kind of zbrush primitive cube (UV and no-UV) (remove the spaces I inserted in my link): https: // dl.dropboxusercontent.com/u/63406920/Misc/ZBrushBoxPrimitives_NVilMaterialTest_26Aug14.zip

Normally, I don't apply UV maps to my zbrush meshes because they just inflate the file size and degrade performance when I'm dealing with a scene of 20+ million polys.  On the other hand, I don't bring meshes that heavy into Nvil.  I guess it all depends on Nvil's material system whether they apply to UVs only, or if it can also deal with just assigning colors to vertices.  So yes, I would prefer if I could bring a non-UV mapped mesh into Nvil and have the default material applied.  But if not, I now understand on a technical level why, and it's really not a huge issue to me.

  • No avatar
  • Posts: 2101
  • Polygon
August 26, 2014, 03:40:54 pm
There was a change a few months ago to solve the issue of .obj files being imported without a .mtl file.

It looks like Nvil (if no .mtl file) is looking into the .obj file for a ref material (usemtl), if there is no material entry, then a white material is added.

Probably my fault, as at the time I was only checking for .obj files with missing .mtl files, not .obj files with a missing .mtl file and no internal defined default material.

  • No avatar
  • Posts: 3711
  • Developer
  • Administrator
  • Polygon

  • No avatar
  • Posts: 2101
  • Polygon
August 27, 2014, 05:49:23 pm
Hi IStonia,

I made tests on the variations I could think of (no .obj internal "usemtl" reference, etc). It now looks OK.

Hopefully others will check.

  • No avatar
  • Posts: 130
  • Spline
August 28, 2014, 08:47:18 am
I just tried this version out as well - the issue looks to be resolved so far as I can see!  Thanks!

  • No avatar
  • Posts: 2101
  • Polygon
September 12, 2014, 09:21:22 pm
Something I find a little annoying with this.

We have the option to "Set Default material" and "Set as fixed default material". But noting is actually set unless you have first created an object in scene, which uses that default material.
If for example, I open a scene (whatever format), the first material found is placed in the first material slot, then any object created after that will be set with that material. So where are the default materials I have set in that case?

  • No avatar
  • Posts: 3711
  • Developer
  • Administrator
  • Polygon
September 14, 2014, 08:19:40 am
I changed "Default material" to "Global default material" and "Fixed default material" to "Local default material". Hopefully it would make sense.

  • No avatar
  • Posts: 2101
  • Polygon
September 14, 2014, 01:20:13 pm
Hi IStonia,

I am not sure as to why simply changing the names (to what you have) would make more sense.

To have a "Global default material" would lead me to believe, that any new object created in scene would be automatically given that material. As that is not always the case, I need to ask as to what your definitions are of the 2 terms you give?.

1. Global default material
2. Local default material






  • No avatar
  • Posts: 3711
  • Developer
  • Administrator
  • Polygon
September 15, 2014, 09:00:34 am
Global default material is actually not an instance of material. It only holds the data that can be used to construct the material.

Local default material is assigned to one of the scene materials. The first material added into the scene is automatically assigned as the local default material.