Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > Community Content / Contribution Project > Other

Reply
 
Thread Tools Display Modes
Old 03-05-2012, 12:44 AM   #1
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
Help finishing Hat?

Hi there,

I could use some assistance. I've read through multiple forums on this subject, and tried to read through everyone's questions first. But I can't get it all together.

Here's my situation.


It took me about 3 hours to model the hat and a few weeks of pouring through forums to get the bones to work right.

I am fine all the way up to export and have been using two export methods, with different results for each.

1. I exported from Maya 2011 to .OBJ files, with .TGA as the skins. This model had a skinned skeleton with the bones named bip_head (placed exactly where the reference bone was) then jiggle_front1, (1-7), jiggle_left1 (1-7, jiggle_right (1-7).
- I have three LOD models. named: JesterCap1.obj, JesterCap2.obj, and JesterCap3.obj.
- There are two textures; JesterCap_Red.tga, and JesterCap_Blue.tga
- I also used Y axis as UP in this export.

2. Using ItemTest in the SDK, I was able to get load everything just fine.

3. Using TestMap in TF2,
it looks right, including the team textures. EXCEPT, no bone action. None at all. It's in the right place, but no movement. Also, the hat disappears when the model is killed.

4. Problems:
No bone action, and the LOD is wrong. There is a more detailed level that isn't showing up at any distance. The one that I'm seeing is JesterCap2.Obj. it's not the lowest LOD, but the middle one.

http://s1172.photobucket.com/albums/...BJExported.jpg





Using Prall to export SMD:

From reading all the tutorials, I saw you need to use jigglebones, and a .qc file. So I started from scratch with my model and began the process of finding a version of Prall's exporter that would work. 2.5 or 2.6.

In all the tutorials, they said to use Z axis as up, and frankly, I've tried Y and Z UP, with no success.

So. Long story short, I won't bother posting my exact process for the export because it didn't work. I know the .qc file is not right, and I'm sure the fix is in there.

1. I exported the 3 .smd files for JesterCap.smd, JesterCap_phy.smd, and JesterCap_idle.smd.

2. Converted the .tga files for the textures to .vtf files.

3. Created the .vmt file.

“VertexLitGeneric”
{
“$baseTexture” “models\player\items\scout\0x006d273c\JesterCap\Je sterCap_Red.vtf”
}

4. Created .qc file

$modelname "JesterCap.mdl"
$model "Body" "JesterCap.smd"
$cdmaterials "models\player\items\scout\0x006d273c\JesterCa p"

$texturegroup skinfamilies { { "modelsplayer\items\scout\0x006d273c\JesterCap\Jes terCap_Red.vmt" } { "JesterCap_Blue.vmt" } }

// Model uses material "modelsplayer\items\scout\0x006d273c\JesterCap\Jes terCap_Red.vmt"
// Model uses material "modelsplayer\items\scout\0x006d273c\JesterCap\Jes terCap_Blue.vmt"

$scale 1.0
$surfaceprop "default"
$keyvalues { "prop_data" { "base" "Cloth.Small" } }
$body "Body" "JesterCap"
$sequence idle "JesterCap_idle" loop fps 1
$collisionmodel "JesterCap_phy.smd"
{
$mass 1
$concave
}
$jigglebone "jiggle_front1" {
is_flexible {
yaw_stiffness 400
yaw_damping .1
pitch_stiffness 300
pitch_damping .1
along_stiffness 300
along_damping .1
length 15
tip_mass 0
angle_constraint 45
}
}
...and so on for the other bones, with the names matching.

5. Compiled the .qc file using GUIStudioMDL - successfully.
all the bones got registered as Jigglebones and work in the model viewer and testmap.

The Problem here, is that the orientation is upside-down, and the textures are missing. The bones are all waggly, and I know how to change that, But I need it to be right side up before I can tweak the numbers.

http://s1172.photobucket.com/albums/...llExported.jpg



As a last ditch effort, I tried DECOMPILING the first OBJ exported version that is oriented correctly, and has the textures assigned right. I wanted to add the jigglebones to the SDK generated .qc file and see about recompiling it.

I can't get it to finish. I know it's not hard, and I just don't know how to do it. All the tutorials use folder paths that are specific to their project and numbers in the QC file that are specific. So I don't know which ones to keep and discard.

Any help is greatly appreciated in advance. You guys have already helped so much.

Thanks.

I would also like to know the range on the jigglebones numbers in the .qc. I have no idea what those parameters really DO. This is a jester's cap, so if anyone knows some good starting points for the jiggle settings, I'm up for it. It needs to flop around like you'd expect some sock like tubes to. Inertia is king here.
peege is offline  
Reply With Quote
Old 03-05-2012, 04:13 AM   #2
Pfefferminz
 
Join Date: Jan 2012
Reputation: 22
Posts: 45
Hi,
nice hat!

Did you watch this jigglebone tutorial?
http://www.youtube.com/watch?v=JP9ce_ygeSA
Here is a jigglebone reference:
https://developer.valvesoftware.com/wiki/$jigglebone

I really don't know why the hat is displayed upside down. But i noticed something in the code of your VMT and QC file which MAY be causing the missing textures:

“$baseTexture” “models\player\items\scout\0x006d273c\JesterCap\Je sterCap_Red.vtf

$cdmaterials "models\player\items\scout\0x006d273c\JesterCa p\"

$texturegroup skinfamilies { { "modelsplayer\items\scout\0x006d273c\JesterCap\Jes terCap_Red.vmt" } { "JesterCap_Blue.vmt" } }

Remove red code, add green code. The texture in your SMD has to be "JesterCap_Red.<filetype>".
You should post your SMD.

Last edited by Pfefferminz: 03-05-2012 at 04:15 AM.
Pfefferminz is offline   Reply With Quote
Old 03-05-2012, 07:35 AM   #3
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
Thanks for the quick reply. I will try that when I get home from work today.
peege is offline   Reply With Quote
Old 03-05-2012, 07:03 PM   #4
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
Thanks for the jigglebone page. I have the bones behaving how I want them to in the model viewer. Still, I can't get the textures to show up though.

The model is right side up in ModelView, but not in the test map also.

I'm also not sure how to attach the smd file..



I don't think this exporter is going to get the LOD right also. Is it possible for me to manually export each LOD model as if it were the main model, and just name them myself? LOD1_JesterCap.smd, and so on? The version that ItemTest created made them with .dmx embedded in the name.
for example:
$lod 6
{
replacemodel "JesterCap.smd" "lod1_JesterCap.smd"
}
$lod 12
{
replacemodel "JesterCap.smd" "lod2_JesterCap.smd"
}

I'd actually be happy to use the one that Itemtest made, because it got everything right except the bones are missing. It's a shame it's so tricky just to export these things.

Does anyone know why the itemtest creates .dmx.smd instead of just .smd?


Current QC File I'm leaving out the LOD stuff until I get the hat on the HEAD and the texture showing up.

$modelname "player/items/scout/0x006d273c/jestercap/JesterCap.mdl"
$model "Body" "JesterCap.smd"
$cdmaterials "models\player\items\scout\0x006d273c\JesterCa p\"

$texturegroup skinfamilies { { "JesterCap_Red" } { "JesterCap_Blue" } }

// Model uses material "models\player\items\scout\0x006d273c\JesterCap\Je sterCap_Red"
// Model uses material "models\player\items\scout\0x006d273c\JesterCap\Je sterCap_Blue"

$scale 1.0
$surfaceprop "default"
$keyvalues { "prop_data" { "base" "Cloth.Small" } }
$body "Body" "JesterCap"
$sequence idle "JesterCap_idle.smd" loop fps 1
$collisionmodel "JesterCap_phy.smd"
{
$mass 1
$concave
}
$jigglebone "jiggle_front1" {
is_rigid {
tip_mass 40
length 10
angle_constraint 30
}
}

$jigglebone "jiggle_front2" {
is_rigid {
tip_mass 10
length 10
angle_constraint 25
}
}



Is it possible that having the slash marks backwards or forwards matters? \ or / ?
peege is offline   Reply With Quote
Old 03-05-2012, 10:01 PM   #5
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
I got the textures working.

Using your corrected qc file AND fixing how I was exporting the file in the first place. Thanks.

For people with my problem.

Make sure you have the actual .tga file that you use for your texture in Maya in the project folder named \materialsrc.
peege is offline   Reply With Quote
Old 03-06-2012, 01:53 AM   #6
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
Is there an easy way in the QC file to flip the model? I'm pretty sure it's bound to the right bone.
peege is offline   Reply With Quote
Old 03-06-2012, 03:18 PM   #7
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
I detached the skin, flipped the model 180, then re-bound it to the bones, all the history was deleted, and Frozen Transformations. Exported, and still upside down. I have tried this over and over, with the Y axis UP, the Z axis UP, with and without flipping each version. There has to be a command for this to just flip or rotate 180.

$origin doesn't seem to work at all. When I use it, the whole model disappears. I think it's out of the room when I try that.

Any ideas on this? My apologies if someone mentioned something in another post.
peege is offline   Reply With Quote
Old 03-06-2012, 04:08 PM   #8
coolguythatrock
 
 
 
Join Date: Sep 2011
Reputation: 0
Posts: 35
ok i know how to fix the orientation. import your original obj and use that. DO NOT ROTATE IT AT ALL. in maya, the axis are the same as in tf2, so no axis rotation is needed. try that it should work..............or if that is too complicated, just open your smd in maya and rotate the MESH NOT THE BONES 180 degrees.

didnt read your other post. post your qc and the first 30-ish lines of your smd
also, the finished product in the model viewer will look like the front of your hat is facing downwards

Last edited by coolguythatrock: 03-06-2012 at 04:10 PM.
coolguythatrock is offline   Reply With Quote
Old 03-06-2012, 05:28 PM   #9
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
I didn't realize the nature of the smd file until now. Thanks.

That is going to help A LOT!

version 1
nodes
000 "ScoutRef1" -1 (this is just the scout model's head. I didn't think it would make it to the smd file since it wasn't in any of the layers for export. )
001 "main" -1
002 "bip_head" -1
003 "joint_base" 2
004 "jiggle_left1" 3
005 "jiggle_left2" 4
006 "jiggle_left3" 5
007 "jiggle_left4" 6
008 "jiggle_left5" 7
009 "jiggle_left6" 8
010 "jiggle_left7" 9
011 "jiggle_right1" 3
012 "jiggle_right2" 11
013 "jiggle_right3" 12
014 "jiggle_right4" 13
015 "jiggle_right5" 14
016 "jiggle_right6" 15
017 "jiggle_right7" 16
018 "jiggle_front1" 3
019 "jiggle_front2" 18
020 "jiggle_front3" 19
021 "jiggle_front4" 20
022 "jiggle_front5" 21
023 "jiggle_front6" 22
024 "jiggle_front7" 23
025 "LOD0_JesterCap" -1
026 "LOD1_JesterCap" -1
027 "LOD2_JesterCap" -1
028 "LOD3_JesterCap" -1
029 "LOD4_JesterCap" -1
end
skeleton
time 0
0 0.00000 0.00000 0.00000 3.14159 0.00000 0.00000
1 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
2 0.00000 0.00000 0.00000 1.57079 -1.38685 1.57130
3 -1.7324 5.63550 -0.0003 0.00000 -1.57079 -1.38685
4 1.47480 1.17940 1.69820 -2.95759 0.20414 0.56038
5 1.64980 -0.0578 -1.3156 0.07457 -0.0017 0.50578
6 1.92980 -0.8688 -0.3419 0.00763 -0.04141 0.63984
7 0.81630 -1.2288 0.67190 0.01604 0.03077 0.68274
8 0.22050 -1.0101 1.77100 3.12092 0.10889 0.27157
9 0.00560 0.63700 -1.7295 0.03900 0.01760 -0.08474
10 0.10490 0.48920 -2.4173 0.00000 1.57079 -1.47112
11 -1.7236 1.19510 1.59390 -0.17553 0.08415 2.23745
12 1.41310 0.00710 1.35280 -0.0053 -0.0462 0.68535
13 1.95160 -0.4612 -0.0980 -0.24226 -0.22787 0.77468
14 0.57780 -0.5973 -2.1805 -2.87069 -0.02437 0.48258
15 0.02670 0.23490 1.78460 0.06222 0.02119 -0.06319
16 -0.0434 0.18000 1.64640 -0.0570 0.02577 -0.03956
17 -0.0521 -0.1207 1.70650 0.00000 1.57079 -1.52453
18 -0.3091 -2.1373 1.54610 0.84232 -0.58305 1.76017
19 -0.2985 2.22180 0.96260 0.16872 -0.19927 0.70879
20 -0.1876 1.65920 -0.1401 -0.04495 -0.06144 0.71556
21 0.03650 1.78870 -0.3086 -3.03105 -0.01483 0.74965
22 0.02860 -1.9921 0.66880 -0.04177 -0.00262 -0.18214
23 0.01940 -1.9146 0.56170 -0.01481 0.06294 -0.09454
24 0.00800 -1.9251 0.51920 0.00000 1.57079 -1.48241
25 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
26 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
27 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
28 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
29 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
end
triangles



This has the bones working how I like them.


Quote:
import your original obj and use that. DO NOT ROTATE IT AT ALL. in maya, the axis are the same as in tf2, so no axis rotation is needed. try that it should work.
Believe me, if it was a static prop, I'd be using OBJ and itemTest to build the mdl. That is a very quick process, and works like it's supposed to. Other than the bones don't export at all. When I import the smd file back into Maya to add the bones, I have to use Prall's exporter to get smd files out of maya, so it's the same problem.




Quote:
just open your smd in maya and rotate the MESH NOT THE BONES 180 degrees
I can't move the mesh once it's bound to the bones. I have to rotate the bones to move it. So that's why I unbound it, and deleted the history and froze transformations. Then re-bind it, and paint the skin weights. This happens no matter which way the model is oriented in Maya...

I am wondering if I need to flip the model, then BUILD a new skeleton upside down as opposed to rotating the skeleton, then bind that. Although that idea just sounds horrible.
peege is offline   Reply With Quote
Old 03-06-2012, 08:01 PM   #10
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
I think I got it to mount in the right spot on the head. I rebuilt the skeleton and re-skinned it.

Edit: Nope...

Last edited by peege: 03-06-2012 at 08:10 PM. Reason: correcting info
peege is offline   Reply With Quote
Old 03-06-2012, 11:17 PM   #11
coolguythatrock
 
 
 
Join Date: Sep 2011
Reputation: 0
Posts: 35
this might be prall's exporter's fault. the exporter i use has some bugs, but they are easy to fix. go to the steamapps\<username>\sourcesdk\maya\2011\plug-ins\ and copy the contents of that folder to your Program Files\Autodesk\Maya2011\bin\plug-ins\

then restart maya. go to your preferences. enable the plugins. THESE NEXT STEPS ARE IMPORTANT. save your scene in the documents\maya\projects\default\scenes\ directory. then go to file>export smd and click the option box. a couple options should come up: export as reference and export each model as seperate mesh. make sure the export as reference is selected. an smd will be exported, and at the end you will probably get a warning like: failure exporting vmt blah blah blah. ignore this stuff. open your new smd: it will be in the documents\maya\projects\default\smd\ folder. open it in notepad++. scroll down. there will probably be something like "debug\debugempty" where your texture should be. highlight this and click control+f. go to the replace tab. and in the box where it says find what, type debug\debugempty (or whatever is in place of your texture) and where it says replace with, type the name of your texture (for example hattexture.tga). see if these export tools work. sorry for the lengthy and complicated answer
coolguythatrock is offline   Reply With Quote
Old 03-07-2012, 03:56 PM   #12
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
I've copied the plug-ins into the directory you specified, and they show up in the plug-in manager in Maya, but they won't load.

// Error: The specified module could not be found.
(vstSmdIO) //
// Error: Unable to dynamically load : W:/Documents/maya/2011/plug-ins/vsMaster.mll
The specified module could not be found.
//
// Error: The specified module could not be found.
(vsMaster) //
// Error: Unable to dynamically load : W:/Documents/maya/2011/plug-ins/vstUtils.mll
The specified module could not be found.

// Error: The specified module could not be found.
(vstUtils) //

http://http://s1172.photobucket.com/...luginerror.jpg

Then I tried going to :\Documents\maya\2011\plug-ins, with the same results. bleh... every step has a ring of fire to jump through.


These are the only plug-ins in the plug-in manager that won't load. I tried checking the other ones just to make sure it wasn't a maya problem.

Last edited by peege: 03-07-2012 at 04:06 PM. Reason: addition
peege is offline   Reply With Quote
Old 03-07-2012, 04:00 PM   #13
KRosen
 
 
 
Join Date: Jul 2008
Reputation: 362
Posts: 779
regarding the slashes, those are delimiters for windows / and linux\ - they do not matter in this case (although in other programming instances they do, ex would be java file system without the VM's platform independent API being utilized) -

if you cannot figure it out from what was posted here, add me on steam and i'll see what i can do if i have time.
KRosen is offline   Reply With Quote
Old 03-07-2012, 08:47 PM   #14
coolguythatrock
 
 
 
Join Date: Sep 2011
Reputation: 0
Posts: 35
um so the actual plugins dont work.....well then look here

http://forums.geshl2.com/index.php?topic=981.0
coolguythatrock is offline   Reply With Quote
Old 03-08-2012, 01:21 AM   #15
peege
 
Join Date: Feb 2012
Reputation: 0
Posts: 17
Thanks for the help.

The problem with it was that my bip_head bone didn't have the same transform information and rotate information. It was because I used the reference heads on the Team Fortress Workshop page.
http://www.teamfortress.com/workshop/
While it worked great to export as an OBJ file, the SMD was off.

So, instead of that, KRosen hooked me up with some info that unlocked it. I needed to be using the reference model from
\Program Files\Steam\steamapps\username\sourcesdk_content\t f\modelsrc\player\scout\parts\smd
instead of the Heads .zip file that TF2 provides...


In that, you get a bip_head bone that has a specific rotation on it. If you use the bip_head bone created at the origin of the Head Reference file, it has NO rotation on it.

I'm pretty sure that was the main problem. I'm obviously new to this.


So, if you intend to export as an OBJ file, using the ItemTest to create the model. The reference heads are fine, but you can't use jigglebones.


And if you want to export with bones, you have to export using Prall's smd exporter. To do that you have to use the .SMD reference from
\Program Files\Steam\steamapps\USERNAME\sourcesdk_content\t f\modelsrc\player\CLASS\parts\smd

Then line your hat up, (since my bip_head was at the origin before, the move for my model was exactly the same as the coordinates of the actual bip_head bone).
delete all the reference mesh, but LEAVE bip_head in place. Then skin your mesh to bip_head.
Export using Prall's smd exporter, and follow the naming structures explicitly. All that is in other tutorials already out there.
It works.

Thanks for all the help. Since I was just trying to get the hat oriented correctly tonight, I didn't use my other bones. It worked though. I still have to sort out some bones issues before I can say I'm done. But I'm past the wall.
peege is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > Community Content / Contribution Project > Other


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.