STEAM 组
Blender Source Tools BleST
STEAM 组
Blender Source Tools BleST
285
游戏中
1,857
在线
成立于
2013 年 11 月 8 日
所有讨论 > Help > 主题详情
MarioMan 2015 年 5 月 30 日 上午 8:38
[FIXED] Import script generates thousands of materials, one per polygon
First of all, thank you for maintaining such a helpful script for the Source engine. It seems that there is a bug in the import script that causes separate material slots to be created for each polygon in a mesh instead of one per actual material in the mesh. I am trying to use this script with Titanfall models. Here is what I'm seeing: http://i.imgur.com/sPzahS6.png
I'm not the only person with the issue. Here is another user that posted the same problem with this tool, likely when importing meshes from a different game: http://blenderartists.org/forum/showthread.php?307815-Remove-1000-materials
Any help would be great. Thanks for reading my post.
最后由 Artfunkel 编辑于; 2015 年 6 月 7 日 上午 7:29
< >
正在显示第 1 - 15 条,共 23 条留言
Zappy 2015 年 5 月 30 日 上午 8:41 
I've had this happen with a Team Fortress 2 cosmetic or two before (but not many), however I think it's more a fault with the decompiler than the Blender Source Tools (although I admit I didn't check the affected cosmetic meshes in Notepad++, so it could be either).
MarioMan 2015 年 5 月 30 日 上午 8:43 
引用自 Vintage
I've had this happen with a Team Fortress 2 cosmetic or two before (but not many), however I think it's more a fault with the decompiler than the Blender Source Tools (although I admit I didn't check the affected cosmetic meshes in Notepad++, so it could be either).
Hmm. Could be. It's just that Crowbar decompiles the model quickly while Blender Source Tools takes forever to run the script on problematic meshes.
Zappy 2015 年 5 月 30 日 上午 8:46 
I assume it takes Blender long to import these mega-material-filled meshes because it needs a little time to set up each and every material, and with thousands of materials...
Artfunkel 2015 年 5 月 30 日 上午 11:33 
Please upload the file you're trying to import.
ZeqMacaw 2015 年 5 月 30 日 下午 2:22 
Ugh. This might be a problem with the latest Crowbar (0.24), as indicated in this GameBanana thread[tf2.gamebanana.com].

Please upload the original (MDL and related) files for the model that is giving trouble so we can troubleshoot and fix the problem.
ZeqMacaw 2015 年 5 月 30 日 下午 2:43 
I just tested a TF2 model with Crowbar 0.24 and 0.19 using Blender 2.73 with BleST 2.4.1.

The model can be found here in TF2: tf2_misc_dir.vpk -- models\workshop\player\items\medic\robo_medic_physician_mask

With Crowbar 0.24, the full path of the material name is listed in the mesh SMD files (reference and lod1). Example:
models\workshop\player\items\medic\robo_medic_physician_mask\robo_medic_physician_mask

With Crowbar 0.19, only the file name is listed in the mesh SMD files. Example:
robo_medic_physician_mask

I made the change in Crowbar 0.24 to write the full path if that is what was found in the MDL file because that's the data that was used to make the MDL.

My guess is that the full name is being clipped in BleST, but should not be. I am not sure what the length limit is for the material name.
Zappy 2015 年 5 月 30 日 下午 2:47 
引用自 ZeqMacaw
I made the change in Crowbar 0.24 to write the full path if that is what was found in the MDL file because that's the data that was used to make the MDL.
Oh, so that's actually completely intentional. I think it's a stupid change, since $CDMaterials...
最后由 Zappy 编辑于; 2015 年 5 月 30 日 下午 2:47
ZeqMacaw 2015 年 5 月 30 日 下午 2:49 
In MDL version 48 studiomdl.exe source code, the length limit seems to be 260 (which probably corresponds to the limit used by Windows).
ZeqMacaw 2015 年 5 月 30 日 下午 2:51 
引用自 Vintage
引用自 ZeqMacaw
I made the change in Crowbar 0.24 to write the full path if that is what was found in the MDL file because that's the data that was used to make the MDL.
Oh, so that's actually completely intentional. I think it's a stupid change, since $CDMaterials...

To avoid other problems and for learning what others actually used to make a model, writing what was actually used to make the MDL seemed best overall.
Artfunkel 2015 年 5 月 30 日 下午 4:24 
The maximum length of a Blender datablock name is 63 bytes of UTF-8, so it's Blender itself doing the trimming.

That also means that it's going to be a pain to import those very long material names properly as Python strings deal with characters, not bytes.

The solution I'm currently in favour of is detecting the common directory at the start of each material name and removing it, which makes Crowbar putting it in a bit pointless. :) Could you possibly stick the common directory into the QC as $cdmaterials instead?
Zappy 2015 年 5 月 31 日 上午 12:23 
引用自 Artfunkel
Could you possibly stick the common directory into the QC as $cdmaterials instead?
I agree.

Plus, if you (ZeqMacaw) want to give people what's used to compile the models, you shouldn't include it, since with DMXes, one can set a material directory root (like $CDMaterials, except not used in texture groups), such as models/player/scout/, and then the materials will be named scout_blue for example, which StudioMDL will interpret as models/player/scout/scout_blue even though the material name is only scout_blue. At least I'm fairly certain that's what's going on. Why would people give the full material path as the material name in a modelling tool when also using $CDMaterials and a material root thing, anyway?

If you need me to confirm that material root thing does this, I can try, but I won't do it if you don't ask me to.
Devieus 2015 年 5 月 31 日 下午 11:48 
引用自 ZeqMacaw
引用自 Vintage
Oh, so that's actually completely intentional. I think it's a stupid change, since $CDMaterials...

To avoid other problems and for learning what others actually used to make a model, writing what was actually used to make the MDL seemed best overall.
I've found this actually confuses people more, it's best to use the $cdmaterials for its intended use. I help people on a regular basis, sometimes they fill out the $cdmaterials, but not change the materials on the mesh, then they're surprised the model can't find the textures.
MarioMan 2015 年 6 月 4 日 下午 8:27 
Thanks everyone for looking into this. It seems my best best is to simply use an older version of Crowbar. Thanks for all the help and the development of such useful tools.
Artfunkel 2015 年 6 月 7 日 上午 7:31 
Very long datablock names are now truncated with a warning. This means that all materials on the model this thread is about will end up being the same, but trying to be clever about fixing it didn't seem appropriate.
Zappy 2015 年 6 月 7 日 上午 8:15 
Truncated, as in cut down to 64(?) characters, or removing anything before a / or \?
< >
正在显示第 1 - 15 条,共 23 条留言
每页显示数: 1530 50

所有讨论 > Help > 主题详情
发帖日期: 2015 年 5 月 30 日 上午 8:38
回复数: 23