Quickly splitting an object into multiple parts?

I’m thinking of making a high poly race track for a game. My preferred method in Blender is to make a plane with track and grass textures, use the Array modifier and then the Curve modifier. Example:

For the track to work in game it needs to be split up into multiple parts. In Blender I can reduce the array count, and use multiple planes with different starting points. The problem I face is that there’s going to be a lot of trial and error to get it right, including texture mapping. If my track is split into multiple parts, remapping textures isn’t going to be fun. I’d have to either change the mapping on each part (there could be 20 of them) or edit the first one and reposition 19 copies.

Does anyone know of a quick way to allow me to keep the track as a single object in Blender, and then quickly split it up into several parts before exporting? I know about selecting vertices and pressing P, and about the Knife tool and the Boolean modifier. They can be slow/messy. I’m willing to have a look at scripting, but first I’d like to make sure I’m not reinventing the wheel.

Ideally it would be possible to mark several ‘split lines’ which are saved with the model (e.g. vertex groups), press something or run a script, the model would be split up, exported, and then the split would be undone/file reloaded. Does anything like that exist?

Oh and I’ll probably export as .fbx or .dae, so there may be something out there that splits up those files instead.

I don’t think think there is an automatic way of doing this. What you’re probably going to want to do anyway (and take this with a grain of salt, as I don’t have experience with game development) is to create several track assets that can be instanced in game to save on memory. You would create a strip of straight track, sharp turn, long turn, etc., export the various parts and then assemble the track within your chosen game engine.

you can seperate geo by material

Thanks for your replies.

cgCody:
The game, rFactor 2, might support instances. The code for placing objects suggests it’s possible, but my track is going to have various changes in gradient, so it’s unlikely I’ll have and two corners or straights that are the same. And even if the track were completely flat, introducing rotation would make positioning way too difficult without getting little gaps between segments.

Pyro: That sounds like a quick solution, but there would be a lot of duplication. A realistic track wouldn’t have more than a few types of tarmac, so I’d be using the same texture files in most places, but assigned to multiple materials. One of the game’s developers once pointed out that material loading can cause a performance bottleneck.

I decided to have a go at a Python script. I currently have something that selects an object with a certain name, edits it, selects the first 3000 polys, and separates them to create a new mesh. I works okay, there’s a sort of looping that happens even though I don’t think it should :smiley:

I’ll keep working on it and if I need help, or when I’ve finished, I’ll start a thread in the scripting forum.

edit
Here is the thread: