Wall Worm Forums

Design Tools => Materials and Textures => Topic started by: joewa on May 12, 2014, 09:59:38 PM

Title: Material Library Generator error + VMF importer exception
Post by: joewa on May 12, 2014, 09:59:38 PM
Posting this here at Shawn's request (https://twitter.com/shawnmolson/status/466031032580308992):

I get what looks like about 90% of the way through generating a material library and throw this error:
"--Unable to convert: undefined to type: Integer"

matgenfuncs.ms opens with this highlighted:

    if ((matchPattern theLine pattern:"*$phong*") == true) then (

addMat.shaderByName = "Phong"
matType = "model"
addMat.forModel = true

if ((matchPattern theLine pattern:"*$phongboost*") == true) then (
addMat.phongboost = val as float
continue
)

if ((matchPattern theLine pattern:"*$phongexponent*") == true) then (
>>>THIS LINE HIGHLIGHTED addMat.phongexponent = val as float
continue
)

if ((matchPattern theLine pattern:"*$phongfresnelranges*") == true) then (
addMat.phongfresnelranges = val as string
continue
)


continue

)

and F11 has this to say:

Welcome to MAXScript.

-- Error occurred in wallworm_generateMaterialFromVMT(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\common\matgenfuncs.ms; position: 18417; line: 796
--  Frame:
--   modelColor: (color 155 155 0)
--   selfIllum: false
--   theLine: ""$phongexponenttexture" "truck/truckspec""
--   vmt: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials\truck\Truck.vmt"
--   dispColor: (color 0 155 0)
--   selfIllumName: ""
--   kwvars: undefined
--   dispColor2: (color 155 155 155)
--   extraRootPaths: undefined
--   nocull: false
--   theVMT: <File:F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials\truck\Truck.vmt>
--   overWriteName: undefined
--   pos: undefined
--   rootPath: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials"
--   color1: undefined
--   addMat: truck/Truck:Standard
--   val: "truck/truckspec"
--   displayMat: undefined
--   diffuseName: "truck/Truck"
--   c: undefined
--   theTex: #("F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials\\truck/TruckEnv.tga", true)
--   dName: undefined
--   envmapmask: "truck/TruckEnv"
--   param: "$phongexponenttexture"
--   bumpName: "truck/trucknormal"
--   op: undefined
--   blendV: Vertex_Color:Vertex Color
--   CanClose: true
--   ambientocclusionName: undefined
--   displayMatnameB: undefined
--   opacityName: ""
--   color2: undefined
--   mp2: Standardmaterial:Standard
--   displayMatname: undefined
--   addMatB: Blend:Blend
--   tex1: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials\\truck/TruckEnv.tga"
--   matType: "model"
--   useMat: true
--   oldm1: undefined
--   lineNum: 16
--   lineArray: #(""$phongexponenttexture"", ""truck/truckspec"")
--   tex2: undefined
--   brushColor: (color 155 155 155)
--   extraPath: undefined
--   isTranslucent: false
--   maxfogdensityscalar: undefined
--   called in vmt loop; filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\common\wwmt_material_library_generator.ms; position: 2963; line: 134
--  Frame:
--   vmt: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials\truck\Truck.vmt"
--   mat: undefined
--   useMat: undefined
--   called in wwmt_ceate_material_library(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\common\wwmt_material_library_generator.ms; position: 4443; line: 204
--  Frame:
--   fileFilter: "*"
--   count: 433
--   total: 468
--   recurse: false
--   project: "SGSR"
--   br: true
--   bl: true
--   oneLibrary: true
--   folderFilter: "*"
--   BrushMaterials: undefined
--   mdl: true
--   ModelMaterials: undefined
--   matContinue: undefined
--   BlendMaterials: undefined
--   message: undefined
--   p: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\materials"
--   AllMaterials: #materialLibrary()
--   called in btnGenerate.pressed(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\common\wwmt_material_library_generator.ms; position: 11288; line: 397
--  Frame:
--   errors: #()
--   message: undefined
>> MAXScript Rollout Handler Exception:
-- Unable to convert: undefined to type: Integer <<




When importing a VMF - seemingly any VMF - I get this:
"Error parsing VMF attempt 1:-- Unknown system exception

Will attempt another 1 times..."
"Error parsing VMF attempt 2:-- Unknown system exception

Will attempt another 0 times..."
There is a common problem with parsing VMF files that causes an *unknown system exception*. This error seems to be random and may be due to a memory buffer overflow in Max.

Wall Worm defaults to trying 20 times to parse a VMF, but you can set this to your own preference.

If you get this failure, try running the import again and/or setting the retry limit higher. Repeated attempts will likely succeed eventually.


It does eventually succeed if I put retry on 999 and leave it overnight.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 12, 2014, 10:04:53 PM
The material library generator error actually went away when I removed Truck.vmt (non-essential anyway) but here's the offending VMT in case it helps:
"VertexlitGeneric"
{
"$basetexture" "truck/Truck"
"$bumpmap" "truck/trucknormal"
"$envmap" "env_cubemap"
$envmapmask "truck/TruckEnv"
"$envmapcontrast" 1
"$model" 1

"$halflambert" 1
"$model" "1"

"$phong" "1"
"$phongexponenttexture" "truck/truckspec"
"$phongboost" "6"
"$phongfresnelranges" "[0.05 0.5 1]"
}




I'm out of touch with Source stuff and haven't touched this particular VMT in yeeeeeeeeears so if there's anything obviously wrong with that I'm not picking up on it.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 12, 2014, 10:13:39 PM
The error with the VMT is now patched in the current version of WW that I just loaded.

As for the VMF import error, I think I'd need you to send me a VMF that is failing. So far, I've never needed to put the reparse limit above 20, even when I was importing the Dear Esther levels which were insane. Perhaps it has something to do with the amount of RAM available? I currently have 12GB.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 12, 2014, 10:32:45 PM
That's probably not it, I have 16GB and it's not getting close to being all used. From what I remember there is a lot that's unconventional/crazy/wrong about this map, but I had the same thing happen with some Ep2 ones... I'll do some tests on simpler maps and if it's not an "every map always does this" thing I'll send you the problem vmf.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 14, 2014, 01:35:11 AM
The map eventually got imported after the 208th retry. Materials are all in there working fine. Problems:

-when I hit "import props from scene entities" I get "there are no entities in the scene with MDLs listed", but the map is riddled with prop_statics, and I'm pretty darn sure I have my modelsrc stuff set up right. Ideas anyone?

-There's bunch of func_precipitation in my map which don't delete when I hit the "tools to hidden layer" button. Admittedly not sure what material I used on them so probably my bad and no big deal anyway.

-A few patches of displacement are missing - weirdly enough mostly big flat ones, my more elaborate ones came in fine. For my purposes also no big deal and unfortunately I can't open Hammer to get a better look at what might have been atypical about those displacements/their brushes.

-Some brushes are crazy F#$@ed up, like this:

(https://farm3.staticflickr.com/2911/14179331791_e475926e98_b.jpg)

which may or may not end up being a problem for me. Haven't yet figured out if there was anything particularly weird about those brushes.

Main thing is the prop bug. :( Still, this tool is amazingly great. Thanks!
Title: Re: Material Library Generator error + VMF importer exception
Post by: Joris Ceoen on May 14, 2014, 04:20:28 AM
Because this is the first time I ever saw someone using the level importer (which is really cool to see!) it's probably some errors that have been lingering around somewhere that Shawn hasn't been able to test. Although he'll notice this thread quickly I'll ping him so he can look into this :) just stay tuned!
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 14, 2014, 08:18:47 AM
I'm sorry you are having these problems :( Without the actual files, it's hard to say.

The whole problem behind the reparse requirements is very odd... and exposes a fundamental flaw in either MAXScript or a method I'm employing to parse the VMF. What is so odd about it is that the failure always happens at random places and eventually works. I have a feeling it is due to memory usage/allocation. Sometimes a file will fail 4 times but work on the 5th... sometimes that same file will work on the first... and sometimes the 11th try. In most cases, the failure is 3-11 in the cases I've tested. My CS 1.6 levels import fairly quickly... and the one displacement heavy level I did for CS:S imports in a few minutes. The Dear Esther levels could take an hour. What is causing your level to fail specifically or take so long is something I really have no answer for.

Regarding the messed up geometry. This is due, ironically, to rounding errors. You can sometimes fix some of these by selecting the  messed up brushes, changing the current setting for Use Default Brush Generation and clicking the button to Rebuild Selected. Unfortunately, this function only works during the same session Max is open when you imported the level. And it is dependent on the version of Max you have. (The alternative method uses MassFX functions to create a hull from the imported brush points and is not guaranteed to have 100% precise vertex locations).

Oddly enough, the messed up brushes (and probably the missing displacements) is due to rounding errors. Yep. And there is nothing I can do about this (unless there is some math ninja that someone can teach me). You can help the cause by Voting here on Autodesk Uservoice for Double Float Precision (http://3dsmaxfeedback.autodesk.com/forums/80695-general-feature-requests/suggestions/1548295-double-precision-for-all-internal-calculations). Essentially, what is happening is that all the slicing of an object via the planes has to check which side of a slice to delete geometry... and sometimes this rounding error causes the wrong side to be thrown away. I do have an idea for a work-around... but it's going to cause even more slowness in the importer... but I can make it an option.

As for the models... this is odd. When you select an entity in the scene, can you see its properties when you open the modify panel? Select one and see what the model path is. WW assumes they are relative paths. So if the model is mymaps/model1.mdl then WW will look for sdk_content_folder/modelsrc/mymaps/mymodel1.qc . This can be a problem because the QC can actually tell the model to export to any random path and name... which means that there is no guarantee that the QC is in the same location in modelsrc as the output model... but without parsing all QCs in the entire modelsrc there is no way to know this... which could be a very long process. Perhaps this sheds some light?
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 16, 2014, 01:18:28 AM
Hey guys, thanks for the mega great support! This might be the first time in Source modding history that anybody has properly supported their software.

If you guys want to check out the exact maps/content I'm working with, I actually open sourced the mod a while ago. You can download it here if you want. (http://www.moddb.com/mods/shotgun-sunrise/downloads/shotgun-sunrise-source) The map pictured above is in there, it's called ss_revolver, and the other one I was trying and had the same problems with, ss_shotgun. The model sources aren't in there, because they don't exist anymore, which is why I batch decompiled them with Crowbar.

When I click a prop_static in the scene, my modify panel just says "Box", no other properties in there. It seems like I just have different coloured little cubes that don't mean anything.

As it happens, none of these problems probably matter much for my purposes - what I'm trying to do is port these old maps to Unreal Engine 4 for shits and giggles (and potentially towards prototyping a new version of Shotgun Sunrise on UE4). I deleted all my screwed up brushes and there's nothing there that I can see that wasn't pretty much just a cube (?!?) so those are easily replaceable, and the prop_statics were probably never going to  be easily importable into the new engine so I guess I'll just place them all again.

I am totally up for helping test this stuff though, I think it's super great that there's a way to get your Source content away from Source now. The Dear Esther Unity port put me onto it, though I was following WWMT from the newsletter for ages.

Let me know if I can help you guys test more or help in any other way! I'll keep trying to do what I'm trying to do. :)
Title: Re: Material Library Generator error + VMF importer exception
Post by: Joris Ceoen on May 16, 2014, 04:44:46 AM
It's really great to see people opening to the Wall Worm Model Tools :) You are entirely right! Every Source level can now be ported to other engines!
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 16, 2014, 05:42:18 AM
Yeah, it's super great.
The problem I'm having at this particular moment is A) UE4 has a maximum of 64 materials per mesh (so I can't just export out the entire level as one mesh, damn) and B) when I export an individual building, say, using Export Selected, as .FBX, when I import it into UE4 it's using all the wrong materials - still materials from my map, just like, SS_WOOD_WALL_002 instead of _022 and stuff like that.

I'll just keep whackin' my head against it.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 16, 2014, 09:44:49 AM
I'm working on some updates to the VMF exporter this morning. I'll hopefully have an update shortly that might alleviate almost all broken geometry. I'm trying to get the Unknown System Exception to disappear. Unfortunately, the message "Unknown System Exception" is about as useful as a Port-a-Potty on the moon.

As for props not having the entity values, my best guess (at the moment) is that your entity cache in WW is missing or broken.

Make sure that your global settings have your FGD path ... and that if the FGD includes other FGD files, the include FGDs exist in the same folder as your FGD. (So usually, base.fgd must exist in the folder with the FGD for your mod).

Regarding the material names not exporting with the FBX exporter... that sounds more like you may need up update FBX. Just search for the latest FBX update for your version of Max.

PS. Now that you are getting into WW some, how about making some content for Source still using WW???? :)
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 17, 2014, 01:55:46 AM
So I haven't had a chance to download your levels but was looking into the parse error problem. I haven't solved it 100% but I have updated a bunch of the code in an attempt to alleviate it. Can you download the latest WW and try to parse a level. Please let me know if it finished before 20 parse attempts.

Here is more info on today's update: http://www.wallworm.net/index.php/topic,1028.msg2758.html
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 17, 2014, 03:38:56 AM
Heyo. I've just updated to the new version (assuming it's not a problem to just paste the new version over the old one?) and I'm still failing after 20 retries. I'm gonna leave one going even so to see if reparsing my fgd cache thing helped with the prop_static issue. Also updated to the latest FBX version so hopefully that helps my material issue, I'll let you know.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 17, 2014, 09:43:35 PM
I just got an import from the new WWMT version and got a slightly different result, I still have pretty much all the same missing or messed up brushes but now the texturing on my displacements is also wrong:
(https://farm3.staticflickr.com/2902/14209166104_966012657a_b.jpg)
You can see how it's supposed to look in the last screenshot.

Still no luck getting prop_statics to have .mdls listed, does this look obviously wrong or anything?
(https://farm3.staticflickr.com/2897/14022657409_021a20888c_o.png)
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 17, 2014, 10:30:14 PM
I'm still pounding my head about this whole error. I imported 3 complex level yesterday, and all worked as expected (despite the odd Unknown System Exceptions that I am closing in on). Although there are some bad brushes, they are not often bad and the displacements seem to be almost always good.

Some models have failed to import for me... but this is only if the gamedir/path/to/modelname.mdl in the game did not match the QC in the modelsrc like  modelsrc/path/to/modelname.qc . So in some attempts, I've had to occasionally move a QC and/or change its name to match.

It could also be that the WW entities cache is not made yet.

Test this: click Wall Worm > Wall Worm Level Design > Point Entities. Is the list populated and can you add a point entity yet? If not, you need to parse the entities... which you can do in the global settings by clicking the Reparse button above your FGD. Unfortunately, this will probably need to be done before the import... as the model import only uses proper WW entities (and not the un-editable entities that are stored using an older format if you don't have the entity cache already).
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 18, 2014, 12:21:10 PM
Regarding the parsing problems... I'm 99% sure I've discovered the root of this problem. If true, I shall have an update to fix this later today.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 18, 2014, 06:57:38 PM
The parse error still appears but is greatly reduced in my current tests. Also, regarding the prop imports... it appears that I had broken this in a recent update to functions in the QC import code. I actually had already set the code to read QC files and find the actual MDL outputs in a big map of assets... but I had forgotten that the code was already written to work this way. When I tested various levels I had and discovered that they would no longer import assets as they have in the past, I looked deeper and see that it was simply broken.

So now I've fixed that... and you no longer have to worry about renaming QC files or moving them... so long as the QC files and SMD files can be found in the modelsrc folders.

Download the latest WW and see if it has any better performance for importing your VMF and the props.

I just did some tests on very large and crazy displacement levels and the times (previously) were an hour on them... now they are importing in around 12 minutes. The props are actually a little slower than last time I tested a really large scene... but that is because WW now imports so much more (like Source materials, LODs, animations, physics models, etc).
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 04:04:40 AM
Oh hey, sounds great. I came in to post that I've now got this error twice after a few hours of trying an import:

"An error has occurred and the application will now close. Do you want to attempt to save a copy of the current scene?"
Which is presumably a pretty useless and generic thing, but let me know if there's a log I can send you. I'll try the new version now!
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 06:07:07 AM
Okay, that import still took ages but happened. This time when I hit "import props from scene entities" I got:

-- No ""toLower"" function for undefined

It also opened Mario_Kart_SMD_Importer.ms and highlighted line 1483.

The log says:

"F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\modelsrc\props\\weaponcrate_reference.smd Imported"
-- Error occurred in wallworm_parse_qc(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\importers\Mario_Kart_SMD_Importer.ms; position: 38566; line: 1482
--  Frame:
--   autoimportseqs: undefined
--   zeroRotations: true
--   dfltOutTangentType: #step
--   OLDdfltOutTangentType: undefined
--   newMultiMat: undefined
--   msh: $weaponcrate_reference001
--   meshes: #($weaponcrate_reference001)
--   xf: true
--   toScale: undefined
--   qcistr: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\modelsrc\props\WeaponCrate_wwmt_custom.qci"
--   extraSequences: undefined
--   collapseMeshes: true
--   skipLODS: false
--   fsource: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\modelsrc\props\weaponcrate.qc"
--   mshphy: undefined
--   dfltInTangentType: #step
--   physsmd: undefined
--   rotateModel: false
--   extaPath: undefined
--   skincount: undefined
--   sc: undefined
--   buildMesh: true
--   deepSearchMaterials: false
--   staticprop: false
--   wwmt: (ww_LOD_wrapper modelName:"WeaponCrate" isset:true alwayscollapse:false target:$wwmt_weaponcrate_reference001_001 targets:#($weaponcrate_reference001) hulls:#() bonesarray:#() hullbonesarray:#() autoHull:false modelSetName:undefined physSetName:undefined lods:#() locked:false layer:"WWMT Layer wwmt_weaponcrate_reference001_001" phys:undefined lodgroup:undefined modelPath:"props" materialPath:"props/WeaponCrate" surfaceprop:"default" staticprop:false illumposition:undefined ambientboost:undefined constantdirectionallight:undefined opaque:undefined mostlyopaque:undefined illumorigin:undefined mass:1.0 automass:undefined concave:true contents:undefined inertia:0.0 damping:0.0 rotDamping:0.0 jointConstraints:undefined phdrag:undefined animatedfriction:undefined masscenter:undefined massorigin:undefined mscale:1 noselfcollisions:false useLocalOrigin:true refSystem:undefined altOrigin:false collapsebones:false shadowlod:undefined expHL1Format:0 idleSequence:true sequences:#() sequencelist:#() weightlistnames:#() weightlists:#() particlesystems:#() ORIGIN:undefined bitmaps:#() materials:#() cam:undefined camMode:false attachmentlist:#() attachments:#() base:"" health:undefined allowstatic:undefined physicsmode:undefined blockLOS:undefined AIWalkable:undefined dmg_bullets:undefined dmg_club:undefined dmg_explosive:undefined ignite:undefined explosive_resist:undefined flammable:undefined explosive_damage:undefined breakable_model:undefined breakable_count:undefined breakable_skin:undefined multiplayer_break:undefined explosive_radius:undefined fadetime:15 motiondisabled:undefined gibs:#() bodygroups:#() morphasvta:true shaderType:"VertexLitGeneric" mapChannel:1 range:#(0) compression:"DXT5" referenceNode:undefined offsetFaces:false lockInitialOrigin:false normalMethod:2 internalOrigin:true rotateRefsystem:false alreadyExported:#() dmx:false proxies:#() isXref:false)
--   CustomQCFile: undefined
--   uniqueNames: true
--   OLDdfltInTangentType: undefined
--   smd: "F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\modelsrc\props\\weaponcrate_reference.smd"
--   scaleSMDs: false
--   rotationAmount: 90
--   scaleMesh: true
--   called in i loop; filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\WallWormUtilities\importModelsForProps.ms; position: 4635; line: 176
--  Frame:
--   dataindex: 1
--   i: 1
--   wwmts: #()
--   modelData: (wallworm_model_import_wrapper modelPath:"models/props/weaponcrate.mdl" modelName:"weaponcrate" orig:"models/props/weaponcrate.mdl" qc:"F:\Steam\steamapps\SourceMods\ShotgunSunrise_dev\modelsrc\props\weaponcrate.qc" wwmt:undefined)
--   wwmt: undefined
--   called in wallworm_import_mdls(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\WallWormUtilities\importModelsForProps.ms; position: 5438; line: 204
--  Frame:
--   proxyLayer: undefined
--   fromArray: "ents"
--   special: #{}
--   ang: 90
--   mdls: false
--   wallworm_model_import_wrapper: StructDef:wallworm_model_import_wrapper
--   theProps: #($prop_dynamic_override001, $prop_dynamic_override002, $prop_dynamic_override003, $prop_physics001, $prop_physics002, $prop_physics003, $prop_physics004, $prop_physics005, $prop_physics006, $prop_physics007, $prop_physics008, $prop_physics009, $prop_physics010, $prop_physics011, $prop_physics012, $prop_physics013, $prop_physics014, $prop_physics015, $prop_physics016, $prop_static001, ...)
--   rotateTheObj: undefined
--   excludeLayer: <MixinInterface:LayerProperties>
--   sel: $objects
--   props: true
--   called in btnModels.pressed(); filename: C:\Program Files\Autodesk\3ds Max 2013\scripts\WallWorm.com\rollouts\VMFImport.ms; position: 12873; line: 303
--  Frame:
--   mdls: false
--   props: true
>> MAXScript Rollout Handler Exception:
-- No ""toLower"" function for undefined <<


As far as I can tell no meshes got imported successfully.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 06:18:00 AM
I removed weaponcrate to make sure it wasn't getting hung up on a particular mesh, and it ain't.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 19, 2014, 07:51:07 AM
OK. I will look into this error.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 19, 2014, 08:03:50 AM
Well that bug is fixed. Or should be. I cleaned the line up so that it shouldn't happen again. I'm not sure how it happened. By the looks of it, that line can only break if the importer detected a collisionmodel but not an actual $model or $body line. Could you send the QC to me so that I can see what is going on, as it might entail some legitimate setup that hasn't been accounted for in the QC importer.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 08:17:08 AM
Sure, here's that .qc (it can be assumed that I have many extremely similar .qcs)
// Created by Crowbar 0.19.0.0

$modelname "props\WeaponCrate.mdl"

$bodygroup "Body"
{
studio "weaponcrate_reference.smd"
}


$cdmaterials "props\WeaponCrate\"

$surfaceprop "default"

$contents "solid"





$sequence "Idle" "weaponcrate_anims\Idle.smd" {
fps 30
loop
}

$collisionmodel "weaponcrate_physics.smd"
{
$mass 1
$inertia 0
$damping 0
$rotdamping 0
$concave

}


$keyvalues
{
prop_data
{
"base" "wooden.medium"
}
}
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 08:19:11 AM
Also, I still need to set retries to 999 to be fairly sure I'll get a successful import eventually. It's kind of interesting how much this varies between the two of us. I have two pretty high-end PCs, both experiencing the same issue. Max 2013, x64.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 19, 2014, 08:29:34 AM
Well I see the issue... the QC uses $bodygroup but not $body. I'll need to address that.

Regarding the varying degrees of success... it may be due to the versions of Max. I only opened Max 2013 once in the last year. Max 2014 viewport is so much better. But I do know that the SMD importer fails on skin weights in 2013, but works correctly in 2014. I've actually never imported a level in 2013 (I had done some tests in earlier iterations maybe, but it would have been a very primitive version).

I'll test in 2013 and see if I get the same results. If so, I'm not sure I will have the time and energy to track it down... as the bug causing this appears to be a weird bug in how MAXScript stores memstreams in memory... and I've been trying to meticulously look for what I can do to solve the problem. But the fact is that I can import the exact same file 100 times, and the Unknown System Exception happens at random locations in the code (and imported file)... and eventually just works. I've contacted Autodesk about this and may get a response--they have been more responsive to developers than you may have commonly heard. So hopefully I get some feedback.
Title: Re: Material Library Generator error + VMF importer exception
Post by: joewa on May 19, 2014, 08:33:01 AM
Hmm, cool, thanks. I may see if I can find a PC with 2014 on it and try there.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 19, 2014, 09:07:34 AM
So I did some tests in 2013. I imported 3 levels. The first (a very simple level with world geo and entities) had 1 parse error but imported in a couple seconds. The second was a simple VMF with a couple displacements, no parse error and imported in a couple seconds. The third level has 600+ world brushes and 300+ displacements, and it imported with 0 parse errors and took 2.5 minutes.

(https://www.wallworm.net/ww_media/ww_tension_import_2013.jpg)

So although there are definitely issues (which require the parse try/catch and retry limits)... I'm thinking that this particular case is something inside your level.

Of course, one thing I'm not sure was discussed is if your version of Max has latest Service Packs? That could also be an issue.

Feel free to email me the VMF and I will test it directly.
Title: Re: Material Library Generator error + VMF importer exception
Post by: wallworm on May 28, 2014, 02:54:30 PM
I did release an update that will affect imports earlier... it will certainly increase the correctness of brushes overall. Could you let me know how this update works for you? Maybe try on a smaller level that might import faster (less displacements) for now.

Hopefully it is giving you more expected results.