Importing an XNALara Model into Source Filmmaker via Blender

Hello Modding Community! It’s me again :v:

You may have seen this thread: http://forum.facepunch.com/showthread.php?t=1585079 where I was trying to get a Source Model into Blender and with your help I had literally zero troubles and learned a quite a lot from the process. So thanks again.

But this whole process has been quite addicting and the whole Modelling scene is starting to get really interesting.
The next logical step for me was to follow the advice of detreter in the last thread and start working with XNALara models since the wide variety of models is insane.
I wanted to import an XNALara model into Source Filmmaker via Blender and the Crowbar Compiler following these 2 tutorials:

I found the first one to be a lot more indepth but I had troubles understanding certain parts of it. The second one is for Gmod so it’s not exactly what I’m looking for.

Getting the XNALara model into Blender was not a problem. It loads with all it’s different textures perfectly, including the rig.
Tricky part starts here.
I skipped most of the parts from this: https://steamcommunity.com/sharedfiles/filedetails/?id=245723825
Getting right to the point where I compile the model for SFM. My thinking was that before I start working on the models rig and the like I’d rather have the compiling work properly before I spend hours deleting certain parts of the rig and the like just to have the model be invisible after compiling.
I exported the rig as .smd and the model itself as .dmx. When I checked, the .mdl file was created just like I specified in my SFM Folder. The materials where all missing from their respective folder though, even though I put this into the .qc

$cdmaterials “models\HarleyDLC”

I was thinking that it’s no big deal since atleast the model compiled but when I looked at it in the Viewer there was nothing there. I expected it to atleast show the geometry with missing textures but it was just empty space.
Why?

.qc looks like this:
$modelname “HarleyDLC/HarleyDLC.mdl”

$surfaceprop “default”

$contents “solid”

$mostlyopaque

$cdmaterials “models\HarleyDLC”

$sequence “idle” {
“anims\ArmatureAction.smd”
fadein 0.2
fadeout 0.2
fps 1
}

I really want to have a go at this but I’ve been checking every step and I don’t know what I did wrong. It kind of sucks because as far as I can tell you really don’t have to do a lot to get them working in Source Filmmaker and you can use everything the model comes with, making it look amazing in SFM by default. Most of the models come with displacement,normal and specular maps and I really want to use all these assets but I’ve kind of hit a dead end here.

The model I am trying to port is Harley Quinn from the Arkham City DLC: https://ogloc069.deviantart.com/art/Batman-Arkham-City-Harley-Quinn-DLC-411449816

I was thinking this may be the best place to ask because of all these amazing ports that get posted here. I know I’m asking for a lot here but there certainly are not a lot of tutorials online.
I’d be grateful for a step by step tutorial, a link to a video or another tutorial, basically anything that could help :v:
Thanks in advance! And sorry for shitting up the section with my threads!

So your endpoint is actually sfm and not blender eh? No prob with that. Its still easier to port the model into SFM (or gmod) and deal with it there, since it gives more accessible (or in your case, familiar) environments and lighting. Doing so only requires a journeyman’s level of familiarity with Blender.

Personally I don’t use SFM, I port straight to GMOD, which means I trade off SFM-centric nuances for a collision model, half the bone limit, and a shittier community. So any comments I make is done from a GMOD porters perspective, although items in GMOD will generally already work in SFM, since its the common denominator, but since its features are not specifically tailored for SFM, it won’t meet most power-user’s needs.

Btw that harley model is pretty nice. I might just steal her outfit for a custom

[editline]12th November 2017[/editline]

DMX is easier, you don’t need .vta for flexes. DMX supercedes SMD, but is annoying you can’t read it in notepad like an SMD, and so you’d have to use dmxconvert. I personally only use DMX

In my opinion, the order is wrong. You want the rig and things taken care of prior to entering the compiler. Because often it will not even compile in the first place. If you get through compiling without an exception thrown, you usually end up with something from bizarro-world And afterwards, making changes to the rig will require a careful re-export of all individual mesh assets, as mesh assets with mismatched rigs will lead you into more headache.

[editline]12th November 2017[/editline]

So, in my opinion, you take care of as much of the rig and stuff as you can before entering the compiler, so that you at least see SOMETHING feasible in the output. Naturally you can make rig edits afterward.

So step 1, take care of pre-compiling needs, which means, know the limitations

Example: from a GMOD mindset:

No more than approximately 100k triangles overall (I dont know SFM limit)
Less than 128 bones (I think SFM is around 256? Dont quote me). BTW they only count bones that are linked to an active vertex group or parented to said bones.
No more than approx 25k triangle per individual mesh part (dont know SFM limit)
No more than 32 distinct collision groups (I think…havent hit the limit in a while. Irrelevant for SFM anyway)
No more than 32 distinct materials (that is, 32 distinct VMTs…I think it was 32. Havent hit the limit in a long time).
No more than around…maybe 15…distinct meshes/bodygroup items (You’ll get the general compiler exception)

[editline]12th November 2017[/editline]

Ok ill have a look at it…

Yeah, it looks like it already meets requirements off the bat (Too many bones for GMOD, but thats like 99% of all models)

Pretty straightforward. Dont see any curveballs. Good Face rig.

Yeah, it’ll be an easy one for you.

My first guess is that, you don’t see anything because you did not provide anything for your QC to actually compile. The only thing you tossed in there is your idle sequence. A sequence is just an animation. For this purpose, we are not animating the model picking up a weapon or doing anything. All we want is the model to spawn in its T-pose, and then we use our SFM or GMOD to pose it. Therefore, you are including the IDLE sequence just to say, “I want it spawned in a T-pose, and not running or doing jumping-jacks.”

The IDLE sequence includes nothing of the actual model. Toss in a

$Model “put-whatever-you-want-here” “harley.dmx” {}

in your QC, you can stick it right under the $modelname line, so it looks like:

$modelname “HarleyDLC/HarleyDLC.mdl”

$Model “put-whatever-you-want-here” “harley.dmx” {}

$surfaceprop “default”

$contents “solid”

$mostlyopaque

$cdmaterials “models\HarleyDLC”

$sequence “idle” {
“anims\ArmatureAction.smd”
fadein 0.2
fadeout 0.2
fps 1
}
////////////////////////////

With the assumption that: “harley.dmx” is the name of the dmx of the model itself.

Afterward, if something did spawn, you might not see it in viewer, because its super small. XPS models come super small. You have to scale it. Two ways:

1: Scale pre-export (what I personally do) : In blender, right click and select armature in object-mode

Press S

Move mouse to adjust scale. Make it Bigger. Alot bigger. Left click to set.

Re-export EVERYTHING that your QC is including. E-V-E-R-Y-T-H-I-N-G. In this case, harley.dmx and your idle smd.

2. Scale pre-compilation: I never do this, but invoke the $scale parameter in the QC, placed before the compiler parses your SMDs.

see: https://developer.valvesoftware.com/wiki/$scale

Thank you for the quick answer!
Actually I don’t plan on this journey ending with Source Filmmaker but the Cycles Render Engine was so, well, impressive that I did nothing but place a simple Plane with an Emission Material and called it a day, I have no idea how to control the light, change values around and the like or how to give my model all its textures, so far I can only give it Normals + Diffuse because the PBR Shader doesn’t have an option for specular or displacement textures.
For this reason I decided as my next step I want to do it vice versa and compile models for SFM, kind of like a placeholder programm with which I can light models and create some fan art.
Blender is defenitely the way to go though :v: Source has its limits.
Sadly I can’t really find a lot of Lighting tutorials besides the basic stuff and Blenderguru.

Also, I tried adding the line you told me and Crowbar compiled a lot more! So that defenitely helped!
Sadly, it was still invisible in the model viewer even after scaling it up 40x in Blender and exporting it again, once the model and once the rig.

I even loaded the exported model up in Blender again! It shows up just fine with rig and everything but the textures are gone for some reason?
I’m going to rewatch the gmod porting video because I may have missed something very important, even with the new line in the .qc file, no materials folder was created again.
Frustrating but eh, I kind of expected that :v:

Glad you like the model and yeah the Gmod community can be kind of annoying sometimes. With their playermodels and NPCs and whatever the fuck.

Change your

$sequence “idle” {
“anims\ArmatureAction.smd”
fadein 0.2
fadeout 0.2
fps 1
}

to one line:

$sequence idle “harley.dmx”