DigiKrafting / blender_addon_substance_painter

Bridge/Pipeline/Workflow import/export for Substance Painter.
GNU General Public License v3.0
94 stars 9 forks source link

Texture Import doesn't work by default because of wrong material naming #10

Closed cubedparadox closed 5 years ago

cubedparadox commented 5 years ago

Using Substance Painter 2019.2.0, Blender 2.80

Repro Steps: -Create new blend file -Remove everything, add a Suzanne -Save blend file -Press "export to substance" button -Throw a material on in substance -Export unreal engine textures in substance -Press the "import from substance" button -Watch as nothing happens

Problem/Solution: -After doing some debugging, I found that there were two problems. --The first issue is that the addon doesn't create a material if one doesn't exist already, and Suzanne doesn't come with a default material. --The 2nd, harder to track down issue, is that blender creates a material named "Material", but when exported to substance, the material name doesn't appear to be preserved, so substance saves out textures with the material name "DefaultMaterial" which ofc breaks the automatic importing. -My workaround is to just make sure the object has a material called "DefaultMaterial", but that's not ideal, really the names just need to be exported properly, and also a new material should be created if one isn't present.

DigiKrafting commented 5 years ago

Hi, I've just uploaded an update which added an option in preferences to "Create Materials" for meshes that do not have one, it's turned on by default. This addon does not do anything with the material names, Blender's built in FBX export handles setting the material names in the exported FBX which the addon passes to SP.