Editing material property of many materials at once?


(Swami Mathtraveler) #1

Hi Sketchfabbers,

I have a scene with MANY materials. I want to conveniently set the Transparency of ALL materials with just one slider adjustment. I tried various things to select multiple materials, but nothing worked. Did I miss the way?

FYI, the source scene objects have "Visibility" set (i.e. opacity), but these are NOT via a material. Unfortunately, these were not respected on export:( I tried OBJ; looking at all the settings. Also tried FBX, but output exceeded my limit for free account:(

Anyhow, I have some workarounds in mind, but of course they involve extra effort that could possibly be avoided.

Any help would be appreciated. TIA...

Swami


(Swami Mathtraveler) #2

Here is an attempt to achieve the desired transparency using materials with opacity... the upload REALLY gives the renderer a headache!:D None of these artifacts are present when I tested Sketchfab's transparency settings (but as mentioned above, w/o being able to adjust these settings en masse, it's just not practical for a scene with over 80 materials!).

FYI, each "bar" object is a separate object in the source scene. Also, the top 3-poly's of one bar may be coplanar to the bottom of an abutting bar. This could certainly confuse the renderer. Also, FYI, I have a "pruned" version, which could be interesting to test, but the final "look" may not be as desired (even w/o artifacts). Hm?...


(Swami Mathtraveler) #3

OK, here is the "pruned" version. It does NOT have the artifacting, so the coplanar 3-polys were the culprits.

So, with transparency working (in some fashion), I'm not sure the effect is better than totally opaque objects. What's really needed is a system to selectively show/hide sets of objects. The current issue is that some rows obscure others, so the underlying patterns cannot be seen. Oh, well, it's been fun:)


#4

I tried various things to select multiple materials, but nothing worked. Did I miss the way?

At the moment we don't have a feature like this. It could be possible with the API...Could you show me an example that's working as you want but you had to set manually? (i.e. " None of these artifacts are present when I tested Sketchfab's transparency settings " )

Unfortunately, these were not respected on export:( I tried OBJ; looking at all the settings.

What software? We respect the transparency in OBJ's MTL library (both d and Tr)

Also tried FBX, but output exceeded my limit for free account:(

This should work for FBX. I'm not sure of the technical details. Again, what software? You can always compress your models into ZIP/RAR/7z (7z is the best compression), or exclude textures until after upload to save space.

If still too big, there's always the referral program.

Also happy to test a sample FBX if you send it to me.

attempt to achieve the desired transparency using materials with opacity

Looks like you're seeing draw-order problems. Our transparency system isn't quite ready for something like this because we don't use true OIT. That's why you see some geometries that you shouldn't depending on where you're looking.

scene with over 80 materials

You also have some 266 separate geometries/meshes, which hurts performance. Ideally, there would be one mesh per material.

In the 'pruned' version, I think you're still seeing draw-order problems, just to a lesser extent. single-sided vs double-sided rendering might make a difference.


(Swami Mathtraveler) #5

Hi James, thx for your help.

Thx for the suggestions. I will look into them; plus the links.

Answering your questions will take a little time. I'll start at the start and end at the end:)...

Here is a graphic showing work in 3ds Max 2016, and in Sketchfab. To be clear, THERE ARE NO MATERIALS IN THE SCENE. Transparency is set in Max as a simple object property. This does not export in OBJ - and not surprisingly so. In a different scene I wrote some code to create materials based on object translucency. (Note: that scene has ~40K objects! Many share a material, for ~80 unique materials in all. As an aside, in one test I combined all objects (sans materials) into one, but it became a single color. Now that I have it with materials I might try the combine thing, again). Anyhow, I hope this gives you something to go on.

[Will address the FBX next...]


(Swami Mathtraveler) #6

AHA! Found this, as regards OBJ/MTL and transparency...

So, in lieu of en masse property setting in Sketchfab, a workaround would be to process the MTL text file. Of course, simply selecting all objects (or materials) in Sketchfab then changing one slider would be optimal.

So, can MTL files be swapped?

Update: I see that you noted Sketchfab respects d/tr, but apparently, this does not get exported by Max's OBJ exporter for transparency as an 'object property'. Perhaps I missed an export setting. Wil have to check... Nope, don't see it anywhere. Off to the googles/forums...


#7

Yes, you have to upload OBJ + MTL if you want anything preserved. That's what I was trying to say when I linked to that page in my original answer.

But, you can't upload a new MTL file after processing, it needs to come with the original upload.

If 3ds Max isn't exporting the d/Tr lines correctly, you can edit the MTL file yourself.


(Swami Mathtraveler) #8

Haha, just updated my most recent post, then saw yours just now.

Yes, I understood/understand that the MTL must be included to have materials defined. The issue was that the MTL didn't get the transparency out of Max:( And, as you can see from my last post, I figured out the MTL post-processing workaround.

It's unfortunate that an MTL cannot be swapped after upload. Is this a technical issue, or a design one? Just curious.


(Swami Mathtraveler) #9

James, you wrote:

"But, you can't upload a new MTL file after processing, it needs to come with the original upload."

Hm? What is behind this design decision? [FYI, I know it's not strictly a techincal issue, because it is a feature in a competitor's 3D model sharing offering.]


#10

It's not technically impossible, although it would take some work.

@waleguene - any additional thoughts on that? Allowing re-upload only the MTL file to an OBJ upload?

My main concern is the MTL library is very, very limited compared to the full range of 3D options (both on Sketchfab and in general). A better solution would be some kind of JSON/XML format/file that could be used to generate all Sketchfab settings and allow presets, etc.

If you look around the forum, this has been discussed a few times, and we might consider it in the future.


#11

can you send me details on the competitor's feature to allow it?


(Swami Mathtraveler) #12

@james:
Re: FBX

My testing did not produce good results:(

Here's a graphic summarizing things...

Will email you a zip w/ related files... Has been sent.


#13

Same result with binary FBX?


(Swami Mathtraveler) #14

Haven't tried binary. Lemme check...


(Swami Mathtraveler) #15

Note the Max's FBX exporter (ASCII) got the object property visibility correct, but got the diffuse color wrong.


(Swami Mathtraveler) #16

Same for binary:(

[padding]


(Swami Mathtraveler) #17

@james, you wrote:

"can you send me details on the competitor's feature to allow it?"

Will send via email... OK, has been sent.


#18

Just one small note on the original 'unpruned' version. Switching everything to single-sided rendering seems to improve things quite a bit. Not perfect, and also very tedious, per your original request disappointed_relieved


(Swami Mathtraveler) #19

Thx for the update.

@james wrote:

"also very tedious"

Yeah, and that was for only 17 objects. Now try 40K objects!:D Also, in some "real" sense, translucent objects should be 2-sided. Oh well, nothing is perfect - but we can always strive to impove:)...