Material Library Generator error + VMF importer exception

Started by joewa, May 12, 2014, 09:59:38 PM

Previous topic - Next topic

wallworm

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.

wallworm

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).

joewa

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!

joewa

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.

joewa

I removed weaponcrate to make sure it wasn't getting hung up on a particular mesh, and it ain't.

wallworm


wallworm

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.

joewa

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"
}
}

joewa

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.

wallworm

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.

joewa

Hmm, cool, thanks. I may see if I can find a PC with 2014 on it and try there.

wallworm

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.



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.

wallworm

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.

SMF spam blocked by CleanTalk