ty
it works on the ".map", when you place a model in your map (md3, ase, whatever) you have an entity in the map file, from the example of the original post:
Code: Select all
{
"model" "models/mapobjects/7g/brazier.ase"
"origin" "384 192 0"
"classname" "misc_model"
}
the last property (classname) indicates that the entity is a model, the first one is the model, and the origin is where the model is placed in 3d. you have on such entity whenever you place a model somewhere in the map
the map file of the second screenshot is a usual worldspawn entity, but I am only interested in the brushes not the entity:
Code: Select all
// entity 0
{
"classname" "worldspawn"
// brush 0
{
( 24 24 0 ) ( -24 24 0 ) ( -24 -24 0 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -24 -24 32 ) ( 24 -24 32 ) ( 24 -24 0 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 24 -24 32 ) ( 24 24 32 ) ( 24 24 0 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 24 24 32 ) ( -24 24 32 ) ( -24 24 0 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -24 24 32 ) ( -24 -24 32 ) ( -24 -24 0 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -24 24 8 ) ( -16 24 8 ) ( -24 -24 8 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
}
// brush 1
{
( -16 24 8 ) ( -24 24 8 ) ( -24 -24 8 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -16 24 27 ) ( -2 24 27 ) ( -16 -24 27 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -22 24 8 ) ( -14 24 27 ) ( -22 -24 8 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 14 24 27 ) ( 22 24 8 ) ( 14 -24 27 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -22 -22 8 ) ( -22 -14 27 ) ( 22 -22 8 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( -22 14 27 ) ( -22 22 8 ) ( 22 14 27 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
}
}
what the script does is adding those brushes into the worldspawn of the map for each model entity, after having translated the clip brushes wrt to the "origin" of the model to clip
Code: Select all
{
( 408.000000 216.000000 0.000000 ) ( 360.000000 216.000000 0.000000 ) ( 360.000000 168.000000 0.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 360.000000 168.000000 32.000000 ) ( 408.000000 168.000000 32.000000 ) ( 408.000000 168.000000 0.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 408.000000 168.000000 32.000000 ) ( 408.000000 216.000000 32.000000 ) ( 408.000000 216.000000 0.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 408.000000 216.000000 32.000000 ) ( 360.000000 216.000000 32.000000 ) ( 360.000000 216.000000 0.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 360.000000 216.000000 32.000000 ) ( 360.000000 168.000000 32.000000 ) ( 360.000000 168.000000 0.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 360.000000 216.000000 8.000000 ) ( 368.000000 216.000000 8.000000 ) ( 360.000000 168.000000 8.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
}
{
( 368.000000 216.000000 8.000000 ) ( 360.000000 216.000000 8.000000 ) ( 360.000000 168.000000 8.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 368.000000 216.000000 27.000000 ) ( 382.000000 216.000000 27.000000 ) ( 368.000000 168.000000 27.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 362.000000 216.000000 8.000000 ) ( 370.000000 216.000000 27.000000 ) ( 362.000000 168.000000 8.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 398.000000 216.000000 27.000000 ) ( 406.000000 216.000000 8.000000 ) ( 398.000000 168.000000 27.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 362.000000 170.000000 8.000000 ) ( 362.000000 178.000000 27.000000 ) ( 406.000000 170.000000 8.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
( 362.000000 206.000000 27.000000 ) ( 362.000000 214.000000 8.000000 ) ( 406.000000 206.000000 27.000000 ) common/full_clip 0 0 0 0.500000 0.500000 0 5 0
}
so in effect, it is exactly as if in radiant, for each model, you had imported the "clip map" into you map and moved the imported brushes on top of your model by hand.
for those knowing a little of programming, the python script is hand-writen lexer/parser for map files that generates an AST, a bit of 3D maths, modfying the AST, and some pretty-printing.
as to "making it public", very likely that I will post the code for whoever is interested, very unlikely that I will do any packaging (front end or whatever). But first, I need to add some extra code to handle independent axis scaling and rotation of models, and I also want to do some cleanup of the code.