TMTK Tools: A Blender Addon for TMTK Creators

Hello,

I know with TMTK existing for 4 years now I am very late to the party, but I still figured some of you folks might find this useful. Every since creating My Blender 2.8 Guide in 2020 I thought there must be a better way of doing this, but while I was aware of Blender's programming API and myself being able to program, I never really cared really looking into it. The last few days however I was sitting at home sick and receiving yet another request at looking at someone's .blend file to see what's wrong with the animation (which I still gladly do btw), I returned to my original thought of automating some of the annoying stuff away.

What I ended up with is a small Blender addon which I creatively named TMTK Tools. You can grab it at https://tmtk.gohax.eu/tmtktools or on Github. What it boils down to is that you can use any Blender version 2.8 or newer (I tested it with every major Version up to 3.3.1) and not worry about TMTKs peculiarities when it comes to preparing the object or animation for export to TMTK.

It currently has the following features:
  • FBX export for TMTK: Sets all the correct parameters for the FBX export and optionally also takes care of eventually necessary adjustments so animations are exported correctly as well. No need to tinker with any Blender Project- or Export-Settings anymore.
  • TMTK animation fix: While built-in to the FBX exporter, this is also available as separate function in case you want to use the default FBX export.
  • LOD creation: Creating LODs is not generally hard, but creating the copies just gets repetitive. This function creates the LOD copies for you, optionally adding pre-configured decimate modifiers as well.
  • Bone Weight Normalization: This is a more precise version of Blender's built-in Normalize All feature for vertex group weights. This sometimes fixes TMTK's ugcArtifactNotFound error for animated items.
  • TMTK Hints: Targeted mainly at new TMTK creators, this function gives basic hints about the currently active object, such as informing about the the presence of LODs, looking for unapplied object mode transformations and checking the object's dimensions for TMTK compliance.
  • ScaleHack: Bypass TMTKs 8m size limit (only works for static objects)
I also created a roughly 5 minute video where I demo the addon by creating a simple animation:

If you have any feedback or suggestions, please do not hesitate to comment this thread or the video linked above. Please do keep in mind that I as a single person can not thoroughly test it in all situations, so I'd recommend keeping a copy of your .blend file around when starting to use the addon so you don't lose your work in case it misbehaves.

If you are using the addon, make sure to check the website for updates once in a while.
 
Last edited:
Thank you so much for sharing, this looks to be a great addition! I use 2.79 myself, and while I seldom create much at the moment, I might just upgrade to use this. Thanks again!
 
Thank you so much for sharing, this looks to be a great addition! I use 2.79 myself, and while I seldom create much at the moment, I might just upgrade to use this. Thanks again!
Thanks. I would have loved to improve backwards compatibility, but the changes between 2.79 and 2.80 not only affected the user interface but of course also the backend, so I would probably have to rewrite large portions of my code to make it work with versions < 2.80. If the game was still in its prime I would actually look into that, but things being as they are I will save myself the effort.
 
I have a question. I've used 3d modeling software (milkshape) and done texturing in the past, but it's my first time learning Blender, so I may be being a total noob here. I figured I'd start with something simple - a flat sign. The tooltips in your extension tell me my longest axis is over 8m, but my dimensions are: x 1.5m, y .05m, z 1.5m. I'm confused?
 

Attachments

  • Image1.png
    Image1.png
    688.7 KB · Views: 78
I have a question. I've used 3d modeling software (milkshape) and done texturing in the past, but it's my first time learning Blender, so I may be being a total noob here. I figured I'd start with something simple - a flat sign. The tooltips in your extension tell me my longest axis is over 8m, but my dimensions are: x 1.5m, y .05m, z 1.5m. I'm confused?

From your screenshot it looks like your object dimensions are correct and the addon is getting the wrong dimensions. However, I cannot reproduce this on my Blender installation. I created an object of the exact same dimensions and the output is fine, I also do not see the code being wrong there. Usually the dimensions my addon reads are the exact same you see in the properties panel. Maybe you are not working with the default unit scale of 1.0?

I updated the addon to a) take into account the scene unit scale and b) print out the object dimensions it detects if it finds the object to be too small/big. This should help fix/find the issue. You can update the addon the same way you install it (redownload from the website and install it; you should then restart Blender to make sure the changes took effect before testing).

If that doesn't fix it, it would be great if you could supply me your .blend file for debugging.
 
Last edited:
Tool reported correctly now. Stuck in "In queue" for the last two hours on uploading to see if everything worked. I'll report back if/when tmtk finishes taking hours to convert a rectangular cube.
 
Ok, it finally uploaded, and I don't know what magic you scripted but no errors from tmtk. On the other hand, there may be an issue or again it may be me being a noob. Your description says that it fixes the y,z axis thing no need to fix it pre-export. Here's my model showing the axis I used. The second picture is its rotation in the game when attempting to put it on a wall. Sorry if it's my noobness, just want to give you thorough feedback (and get hints on what I'm doing wrong, if anything).
Image2.jpg

Image1.jpg

(Yes, I know I forgot the _OP map)
 
Last edited:
Ok, it finally uploaded, and I don't know what magic you scripted but no errors from tmtk. On the other hand, there may be an issue or again it may be me being a noob. Your description says that it fixes the y,z axis thing no need to fix it pre-export. Here's my model showing the axis I used. The second picture is its rotation in the game when attempting to put it on a wall. Sorry if it's my noobness, just want to give you thorough feedback (and get hints on what I'm doing wrong, if anything).
I see, yeah the statement about the axis might be confusing for new users since there is some legacy attached to that issue. The export axis setting is purely to fix some lighting issues encountered in the past, see (among others) this post. I rephrased that sentence now to be less confusing.

The actual object orientation still has to be manually adjusted and is different depending on what you want to create. Here is a short rundown:

Grid Items (wall pieces etc.): Those should be centered on the origin point (0,0,0) in Blender.

Non-grid, standing items (statues etc.): Those should "stand" on the origin point, the Z-Values of all vertices being 0 or higher. Vertices with negative Z-Values will be sunk into the ground when placing the item ingame.

Non-grid, wall signs (what you apparently want to create): Those should "lie" on the origin point, so also all vertex Z-Values being 0 or higher. The top of the item should point towards negative Y, the bottom to positive Y. This is just due to how "Align to surface" works in Planet Coaster. See for example the hieroglyph I once created (red: X, green: Y, blue: Z):

1666336480775.png


In conclusion, you can think of all non-grid items getting "attached" to the Planet Coaster world by sticking it to the surface at the origin point.
 
Last edited:
Thank you for the clarification. If I understand correctly then, the y, z-thing is no longer an issue with blender 3.3? Or should I still follow the tutorial videos saying to reorient the axis for y and z before exporting? I really appreciate the info, and I am thrilled to have your tool to handle whatever I was doing wrong originally. It has allowed me to use blender 3.3 which I find much more user-friendly than older versions.

Btw, is that hieroglyph available in the workshop? I am doing an egyptian theme in part of my park. The outline hints it is very well made.
 
Last edited:
If by the "y, z" thing you mean the "Forward" and "Up" settings in the default FBX export dialog, then yes, since 2.8 the defaults are fine. If you use the FBX export from my addon, then it pretty much is "what you see is what you get" (it automatically picks all the correct options for export). You still have to place your item correctly in Blender depending on the type of object you want to create to make Planet Coaster's "Align to Surface" work as expected (as described in my last comment), but other than that you no longer need to do special preparation for export as described in some tutorials for Blender 2.79 and earlier. The object should be oriented in Blender the same way it should be oriented ingame. If you position your wall sign in Blender the same way I did in my above screenshot and then use the addon's export function, it should behave correctly as wall-sign ingame.

You can quickly check for the correct orientation of your wall sign in Blender by pressing 7 on your number pad (or click View ➜ Viewpoint ➜ Top) to go into top view. You should see the front side of your item, but upside down.

And yes, the few hieroglyphs I made are available: https://steamcommunity.com/sharedfiles/filedetails/?id=2543933699
 
Last edited:
Success. Thank you for your help. And thank you for your tool script. When I get to animated objects I'll update if I encounter any issues. Thank you again.
Ok, great. If you start creating animations I recommend updating the addon once again as I just added support for non-default unit scales (meaning unit scales other than 1.0) to the animation fix. However, I recommend using the default scale of 1.0 anyway.
 
Last edited:
Hey, do you think you could help me out with an issue I'm having? I keep getting [Bad Bone Weights] errors when uploading animated items. I tried using the "Bone Weight Normalization" tool from this addon, as well as the "Normalize All" option in the weight painting menu. Everything looks fine in blender when I do this, none of the vertex weights sum to > 1, yet the TMTK keeps throwing the error.
 
Hey, do you think you could help me out with an issue I'm having? I keep getting [Bad Bone Weights] errors when uploading animated items. I tried using the "Bone Weight Normalization" tool from this addon, as well as the "Normalize All" option in the weight painting menu. Everything looks fine in blender when I do this, none of the vertex weights sum to > 1, yet the TMTK keeps throwing the error.
That is odd, have you confirmed the weights are normalized for all LODs? If you want me to take a look at your model, you'll have to send me your .blend file. I'll send you a private message regarding this.


Update:
After Spyro sent me the .blend file as well as the .fbx files in question, I could identify the problem.

Root cause were the decimate modifiers, which to my guess were not applied before normalizing the weights. While Blender somewhat re-normalizes already normalized weights when applying modifiers, it does not do so reliably. The second effect of the decimate modifiers is that vertices might get assigned to additional vertex groups as they are merged, but TMTK only allows a maximum of four groups (even if you renormalized after applying the modifiers, you would get the [Too Many Influencers] error in TMTK). I noticed some vertices with 5 or 6 groups in the .fbx file.

While I never officially documented this, the normalization of my addon also removes these additional groups in order to avoid [Too Many Influencers]. However, I noticed that I incorrectly implemented this feature so my addon could fail with an error message if a vertex had more than 5 groups. I only got this error on Blender 3.4 and not 3.3 funnily enough, but whatever...I updated my addon to fix this, so it should work for both Blender versions now.

So @Spyro1997, these are the steps which probably fix your problem the fastest:
  1. Update my addon to version 0.2.5 (updating works the same as installing it fresh)
  2. Either apply all decimate modifiers manually OR select "Apply Modifiers" when performing step 3 (see screenshot below; this does leave the armature modifiers intact)
  3. Select all LODs and apply the normalization from my addon (it should say it fixed about 4000 vertices at the bottom)
  4. Now it should be ready for export. I'd not save the project after exporting but rather undo the last steps or reload the project so the decimate modifiers stay unapplied. This is easier to work with while modelling.
1674224426131.png
 
Last edited:
For those of you creating objects that are smaller then 0.05 in any axis. and your experiencing fall off at 8m in game. This is because most of the larger object options render in game by object mass and by LOD3 on smaller objects stop rendering. To stop the fall off on tinny objects when your in the tmtk compile uploader in your options panel set Scenery Category to Wall Decorations. As this setting removes the object mass fall off limiter because these type of objects are meant to be small ;)
no fall off.png
 
That is odd, have you confirmed the weights are normalized for all LODs? If you want me to take a look at your model, you'll have to send me your .blend file. I'll send you a private message regarding this.


Update:
After Spyro sent me the .blend file as well as the .fbx files in question, I could identify the problem.

Root cause were the decimate modifiers, which to my guess were not applied before normalizing the weights. While Blender somewhat re-normalizes already normalized weights when applying modifiers, it does not do so reliably. The second effect of the decimate modifiers is that vertices might get assigned to additional vertex groups as they are merged, but TMTK only allows a maximum of four groups (even if you renormalized after applying the modifiers, you would get the [Too Many Influencers] error in TMTK). I noticed some vertices with 5 or 6 groups in the .fbx file.

While I never officially documented this, the normalization of my addon also removes these additional groups in order to avoid [Too Many Influencers]. However, I noticed that I incorrectly implemented this feature so my addon could fail with an error message if a vertex had more than 5 groups. I only got this error on Blender 3.4 and not 3.3 funnily enough, but whatever...I updated my addon to fix this, so it should work for both Blender versions now.

So @Spyro1997, these are the steps which probably fix your problem the fastest:
  1. Update my addon to version 0.2.5 (updating works the same as installing it fresh)
  2. Either apply all decimate modifiers manually OR select "Apply Modifiers" when performing step 3 (see screenshot below; this does leave the armature modifiers intact)
  3. Select all LODs and apply the normalization from my addon (it should say it fixed about 4000 vertices at the bottom)
  4. Now it should be ready for export. I'd not save the project after exporting but rather undo the last steps or reload the project so the decimate modifiers stay unapplied. This is easier to work with while modelling.
View attachment 342321
I would like to point out it is possible during decimate or blenders recalculate weights. for weights to go past 1.0 these weights will appear on the model as being a hot pink color. Not sure if your software accounts for weights past 1.0 but that issue generally happens during advanced character rigging like animals where there is multiple bones crammed in a small space like a head. At any rate that issue would trigger the common ufcArtifact error and fustrate a lot of new users. ;)
 
I would like to point out it is possible during decimate or blenders recalculate weights. for weights to go past 1.0 these weights will appear on the model as being a hot pink color. Not sure if your software accounts for weights past 1.0 but that issue generally happens during advanced character rigging like animals where there is multiple bones crammed in a small space like a head. At any rate that issue would trigger the common ufcArtifact error and fustrate a lot of new users. ;)
Thanks for pointing that out. The addon doesn't care if the weights are < 1.0 or > 1.0, the calculation is the same and it should™ normalize fine either way. However, I'd not be surprised if there is some pitfall I didn't think about, such as Blender actually internally clamping these weights and treating them as 1.0 when previewing the animation.
 
Can you add a boolen to your wall generator to instantly poke a hole or multiple holes in the walls, X/Y and off set X/Y/Z. A box, circle or box/arch window/door hole Variant.
 
Can you add a boolen to your wall generator to instantly poke a hole or multiple holes in the walls, X/Y and off set X/Y/Z. A box, circle or box/arch window/door hole Variant.
Sorry, I feel like that is too specific of a thing to implement at this stage. It only saves a few clicks, likely won't be used by many users and can never be as flexible as manually adding a shape and a boolean modifier yourself.
 
Top Bottom