Multiple Brushes use one Model

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Multiple Brushes use one Model

Post by Barbie »

I was very surprised: in map AS-Airporterror I changed Brush282 and 7 other brushes changed accordingly and simultaneously (for example Brush267). If I view them in T3D, all are referencing "Model'MyLevel.Model268'".

How can such happen?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Hellkeeper
Inhuman
Posts: 905
Joined: Tue Feb 25, 2014 12:32 pm
Personal rank: Soulless Automaton
Location: France
Contact:

Re: Multiple Brushes use one Model

Post by Hellkeeper »

If you open the first instance of this type of similar brush in notepad, you'll see it has a long list of polygons with the coordinates of each vertex.
Begin Map
Begin Actor Class=Brush Name=Brush2
CsgOper=CSG_Add
Location=(X=-256.000000,Y=-128.000000,Z=-64.000000)

Begin Brush Name=Model3
Begin PolyList
Begin Polygon Item=sky
Origin -00256.000000,+00128.000000,+00128.000000
Normal +00000.000000,+00000.000000,+00001.000000
TextureU +00001.000000,+00000.000000,+00000.000000
TextureV +00000.000000,+00001.000000,+00000.000000
Pan U=0 V=0
Vertex -00256.000000,+00128.000000,+00128.000000
Vertex -00256.000000,-00128.000000,+00128.000000
Vertex +00256.000000,-00128.000000,+00128.000000
End Polygon
[...]
End Brush
Brush=Model'MyLevel.Model3'
PrePivot=(X=-256.000000,Y=128.000000,Z=-64.000000)
End Actor
End Map


Subsequent versions of the brush will lack this and instead contain only

Begin Map
Begin Actor Class=Brush Name=Brush3
CsgOper=CSG_Add
Location=(X=-256.000000,Y=-128.000000,Z=-64.000000)
Brush=Model'MyLevel.Model3'
PrePivot=(X=-256.000000,Y=128.000000,Z=-64.000000)
End Actor
End Map


Since it only references a brush model type (in this example, Mylevel.Model3), any modification made on one of these brushes will be performed on the model they all link to and they will all be affected. It's quite a handy and neat way to transform a lot of similar brushes at once. Applying textures, texture alignment and surface parameters to a surface also works on all instances but requires a geometry rebuild to take effect.
Transform Permanently does not change the behaviour of these brushes.

To make brushes like that, simply create one instance of a brush you want to have multiple linked copies of, copy it and paste it into notepad, then remove everything between "Begin Brush" and "End Brush". You should have an empty brush with only the model reference and the usual CSG, pivot, location etc. Paste it in the editor. At this point, changing something on either brush should have immediate repercussions on the other one.
It's a cool trick.
You must construct additional pylons.
User avatar
Tyr
Skilled
Posts: 152
Joined: Thu Nov 26, 2015 11:07 pm
Location: Germany (NRW)

Re: Multiple Brushes use one Model

Post by Tyr »

I had this happen also from time to time that a copied brush will also get edited if i change the shape of the base brush and vice versa. It happens very rarely but depending on the complexity of the brush it starts pissing me off. Same goes for texture alignments.
Released:
Image
Post Reply