by Preach » Sat Feb 09, 2008 10:47 am
Arrrghghgh in some ways blender is a little annoying. For instance, they have a built-in function for creating gui buttons/gui menus. One of the parameters it takes is the "default" value, which all sounds great and sensible. The problem is that in order to redraw the gui, the function to create the button is run again, which resets it to it's default value! The only workaround I can find is to pass the known value of the button as the default value parameter of the create button, so that every time it's redrawn it's recreated with the default value it's already known to have(I later found this is what the working buttons in the gui were already doing). Of course, none of this is documented in the blender manual, presumably because writing that up would cause the developers to die of embarrassment.
So, new version of the script is up at
Features this time are added are:
*Scale button now works.
*Added a flags parameter. At the moment this is just a number entry field, if people really need I could change it to a series of toggle buttons for each flag. There's no way to make check boxes in the standard package.
*Added UV fixing options. Translate UV's means that UV's outside the range are moved up/down by skinwidth or skinheight until they are in the range [0,skin(height or width) - 1]. This is useful if you find the uvs are aligned up with the skin, but in the range [-1,0].
Clamp UV's just moves any points which are out of range to the nearest edge of the skin, so if it's at -5 it gets moved to 0, if it's at skinwidth it gets moved to skinwidth - 1.
As a promo, I spent 30 mins converting one of those sweet TF2 low poly models to mdl format. The time consuming things were duplicating the polys that should be double-sided and making a conversion of the skin to the quake palette, once you use the blender "Consolidate onto one image" function the actual conversion is painless.