neverhood311 / Stop-motion-OBJ

A Blender add-on for importing a sequence of OBJ meshes as frames
GNU General Public License v3.0
688 stars 53 forks source link

Material update #169

Open digimolecules opened 2 years ago

digimolecules commented 2 years ago

Hi, First of all, great add-on! I've been playing with it for my molecular dynamics simulations and it works great event data uploaded is heavy (using Blender 3.2). I have several objects and one mtl file for the materials.

The main issue I see is that if I import with Material per frame enable, it imports correctly the materials assigned, but instead of having a single material for each type of atom and all the frames (let's say blue for all the carbons in the different frames, red for oxygens, ...) it creates a copy of the atom material for each frame (carbon, carbon_001, carbon_002, ...). So if I want to modify it, I need to reassign the material frame by frame (talking about hundreds) and then change it.

If the option is disabled, it works in the sense it assigns the same material for all the frames, but then all the atoms are assigned with the same material (carbon and oxygen have the same material as blue). And I cannot change it.

I don't know if I explained it well. Sorry. Any suggestion?

neverhood311 commented 2 years ago

Yes, I understand. I encountered the exact same problem with one of my projects. If you're willing to try out a beta version, there's a feature in v2.2.0.beta.0 that solves this problem. Note that it's only enabled for Cached Sequences. It will not work for Streaming Sequences.

Here's the process:

This operator will search through all the materials in the sequence looking for materials with the same name (except the .00x on the end) and merge them into a single material. In my tests, this works even when the sequence has multiple materials per frame.

Try it out (remember that it's a Beta version) and let me know how it goes.

digimolecules commented 2 years ago

Thanks for the quick reply. I've tried to install the add-on (removing the previous one) and I got this error when enabling de add-on:

Screenshot 2022-09-30 095304

Is there something wrong with my configuration? Thanks

neverhood311 commented 2 years ago

I'm not sure what's going on here. How did you remove the previous one? Did you install the new one the Install... button and find the .zip file with the addon?

digimolecules commented 2 years ago

Sorry for the late reply (a little bit busy these days). Made a fresh install of Blender (now 3.3.0). I've installed v2.2 and followed your instructions. It works perfectly for my full sequence!

Probably I did a mess during the installation. Thanks a lot, Justin!