LuxBlend25: Save/Load lbm2 corrupts materials?

Discussion related to the 'LuxBlend' Blender 2.4+ python exporter script.

Moderators: Ratow, SATtva, coordinators

LuxBlend25: Save/Load lbm2 corrupts materials?

Postby bighouse » Sat Mar 03, 2012 12:40 pm

I have been converting some old materials to lbm2 format. When I try to use the saved materials, none of them will load properly.

Here is an example with a simple material. I created this manually.

Image

After saving to lbm2, restarting blender, reloading the scene (luball5) and loading the lbm2, I get:

Image

A bump map with a texture? Where did that come from?
Here is the texture:

Image

That texture just looks broken, never mind that I didn't create it in the first place.

More complex materials are broken in more complex ways. Materials with populated texture slots will load with all of the slots empty, but the textures available in the drop down menu. I can reconnect them, but that defeats the whole purpose of saving them in the first place...

Texture names also disappear, replaced with what look like hashes.

Materials downloaded from the database work properly, but are corrupted if I save them locally.

Could I be doing something wrong when saving as lbm2? Or when loading them?

Blender version: 2.62 r44606
Luxblend25 version: 9f2083f538ec
bighouse
 
Posts: 22
Joined: Mon Sep 06, 2010 11:48 pm

Re: LuxBlend25: Save/Load lbm2 corrupts materials?

Postby bighouse » Tue Mar 20, 2012 12:29 am

Would someone do me the courtesy of, at least, telling me if the lbm2 load/save function is supposed to work? I simply cannot save any material beyond the most basic without it being mangled in some way.

To wit:
    Bumpmaps are unusable. They are created when I don't want them and lost when I do want them.
    Textures are disconnected from their parent material or disappear completely.
    IORs are not saved with basic materials, e.g. glossy.

I am at my wits end.
bighouse
 
Posts: 22
Joined: Mon Sep 06, 2010 11:48 pm

Re: LuxBlend25: Save/Load lbm2 corrupts materials?

Postby J the Ninja » Tue Mar 20, 2012 1:40 am

bighouse wrote:Would someone do me the courtesy of, at least, telling me if the lbm2 load/save function is supposed to work? I simply cannot save any material beyond the most basic without it being mangled in some way.

To wit:
    Bumpmaps are unusable. They are created when I don't want them and lost when I do want them.
    Textures are disconnected from their parent material or disappear completely.
    IORs are not saved with basic materials, e.g. glossy.

I am at my wits end.


Whoops, meant to reply to this but forgot to. Sorry

The bump map thing is probably coming from the way bump and normal mapping is handled internally. Lux has no separate normal map slot, so what that normal map slot does is combine itself with the bump map as a multi mix texture, which is what you are seeing here. I don't think it will actually hurt anything to just leave it there. It definitely won't hurt anything if you disconnect it from the bump map channel.

If you use the "multiply" (the "M") button, that causes luxblend to generate a scale texture which is uses to do the actual multiplication. That gets read back in from the lbm2 as an actual scale texture.

The problem with IOR is that Luxblend25 uses a bool switch (that "use IOR" checkbox) to note whether a material uses IOR or a specular color. The problem is, it doesn't actually work that way in the scene file. The core just ignores specular color if an IOR is given (or maybe I have that backwards). But in any case, there is no lxm param to tell luxblend25 that the material should be loaded with useior=true, so it loads it as false and reads in the specular color, which I think is 1.0 (aka, IOR=infinity, aka, completely useless).


Textures disappearing....that shouldn't be happening. Not entirely sure what is going on there.


tl;dr It sort of works, but the lbm2 format doesn't currently account for any exporter abstractions that are used. Perhaps we should consider adding on a section where exporters can add parameters specific to their implementation of materials?
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: LuxBlend25: Save/Load lbm2 corrupts materials?

Postby dougal2 » Tue Mar 20, 2012 2:52 am

The lbm2 format can store any amount of material metadata, which could be used to help lb25 restore the original material settings

ref: viewtopic.php?f=10&t=5838
User avatar
dougal2
Developer
 
Posts: 3073
Joined: Mon Jan 14, 2008 7:21 am

Re: LuxBlend25: Save/Load lbm2 corrupts materials?

Postby bighouse » Tue Mar 27, 2012 1:07 am

Thank you for the replies, I appreciate them.

With some experimentation after reading J's reply, I think I understand the source of my frustration: On saving, luxblend25 is altering my input and discarding the original. I've found that items aren't really missing; they've been transformed and rearranged. This doesn't matter when exporting for rendering, so long as Luxrender can parse the output. However, the effect is maddening when working with the UI as it gives the appearance that the material has not been saved properly. If at all possible, please try to return the UI to the state the user left it in. Not only is this less confusing, but it makes later modifications to a material much easer. If the input must be changed, at least issue a warning so the user knows what is going on.
bighouse
 
Posts: 22
Joined: Mon Sep 06, 2010 11:48 pm


Return to LuxBlend (Blender Exporter)

Who is online

Users browsing this forum: No registered users and 2 guests