Page 1 of 1

Snapping part of brush vertices to grid

Posted: Sun Aug 09, 2020 4:53 pm
by Buggie
How to snap to grid some (not all vertices) from brush?

Assume I build cube, disable grid snap, move little.
And now I want one plane snap to grid, not touch or move another cube.

How to do this?

Re: Snapping part of brush vertices to grid

Posted: Sun Aug 09, 2020 7:34 pm
by Barbie
Export to T3D, round the decimal places, reimport it. If the brush is not too complex, it works acceptable fast; even faster if your editor has a "Replace All" command.

Re: Snapping part of brush vertices to grid

Posted: Sun Aug 09, 2020 7:55 pm
by Buggie
Maybe I am wrong, it will destroy textures align and scale?

When edit vertices I can use MODE TEXTURELOCK=1 for prevent this.

Also it is huge terrain brush. Very hard decide where located need vertices. I do not want touch any vertices which already connected with another brushes.

In general I want remove some polygons by drag vertices in one point.

Testing for cube show this remove polygons, and nothing bad happens. Maybe I am wrong again.

Re: Snapping part of brush vertices to grid

Posted: Sun Aug 09, 2020 9:57 pm
by Barbie
Editor crashes if I want to reduce vertices; here I tried to reduce an orthogonal square prism to a triangle prism by dropping 2 vertices on 2 existing ones:
CriticalError.jpg
CriticalError.jpg (16.34 KiB) Viewed 142 times
How do you try to reduce vertices?

Re: Snapping part of brush vertices to grid

Posted: Sun Aug 09, 2020 10:26 pm
by Buggie
v436 crash. v469 not crash.

Map from v469 loaded in v436.

Copy brush to text show it is look like normal brush without any problem.

Code: Select all

Begin Map
Begin Actor Class=Brush Name=Brush0
     CsgOper=CSG_Subtract
     MainScale=(SheerAxis=SHEER_ZX)
     PostScale=(SheerAxis=SHEER_ZX)
     Level=LevelInfo'MyLevel.LevelInfo0'
     Tag="Brush"
     Region=(Zone=LevelInfo'MyLevel.LevelInfo0',iLeaf=-1)
     Location=(X=-128.000000,Y=-128.000000,Z=-128.000000)
     bSelected=True
    Begin Brush Name=Model4
       Begin PolyList
          Begin Polygon
             Origin   -00128.000000,+00128.000000,-00128.000000
             Normal   +00000.000000,+00001.000000,+00000.000000
             TextureU +00001.000000,+00000.000000,+00000.000000
             TextureV +00000.000000,+00000.000000,-00001.000000
             Vertex   -00128.000000,+00128.000000,-00128.000000
             Vertex   -00128.000000,+00128.000000,+00128.000000
             Vertex   +00128.000000,+00128.000000,+00128.000000
             Vertex   +00128.000000,+00128.000000,-00128.000000
          End Polygon
          Begin Polygon
             Origin   +00128.000000,+00128.000000,-00128.000000
             Normal   +00001.000000,+00000.000000,+00000.000000
             TextureU +00000.000000,-00001.000000,+00000.000000
             TextureV +00000.000000,+00000.000000,-00001.000000
             Vertex   +00128.000000,+00128.000000,-00128.000000
             Vertex   +00128.000000,+00128.000000,+00128.000000
             Vertex   +00128.000000,-00128.000000,+00128.000000
             Vertex   +00128.000000,-00128.000000,-00128.000000
          End Polygon
          Begin Polygon
             Origin   +00128.000000,-00128.000000,-00128.000000
             Normal   -00000.707107,-00000.707107,+00000.000000
             TextureU -00001.000000,-00000.000000,-00000.000000
             TextureV +00000.000000,+00000.000000,-00001.000000
             Vertex   +00128.000000,-00128.000000,-00128.000000
             Vertex   +00128.000000,-00128.000000,+00128.000000
             Vertex   -00128.000000,+00128.000000,+00128.000000
             Vertex   -00128.000000,+00128.000000,-00128.000000
          End Polygon
          Begin Polygon
             Origin   -00128.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
             Vertex   -00128.000000,+00128.000000,+00128.000000
             Vertex   +00128.000000,-00128.000000,+00128.000000
             Vertex   +00128.000000,+00128.000000,+00128.000000
          End Polygon
          Begin Polygon
             Origin   -00128.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
             Vertex   -00128.000000,+00128.000000,-00128.000000
             Vertex   +00128.000000,+00128.000000,-00128.000000
             Vertex   +00128.000000,-00128.000000,-00128.000000
          End Polygon
       End PolyList
    End Brush
     Brush=Model'MyLevel.Model4'
     PrePivot=(X=-128.000000,Y=-128.000000,Z=-128.000000)
     Name="Brush0"
End Actor
End Map

Re: Snapping part of brush vertices to grid

Posted: Thu Aug 13, 2020 11:47 pm
by Buggie
I found way get rid of unnecessary polygons. Even on v436.

This hack based on BSP optimization: if distance between vertices less 0.25, then its merged to one.

So you just need drag vertices to near each one in distance less 0.25.

So you need make maximal zoom. Drag vertices with enabled grid step=1 max close.
After that type
MODE SPEED=0.1 TEXTURELOCK=1 SNAPDIST=1
for set speed very low and possible drag more over 1/3 uu.
Drag vertices without grid lock very close.

For return proper speed for mouse - use button on UEd panel. Also do not forget enable grid lock back.

Now on build this poly will be eliminated during optimization process. Even on v436.

Checked on cube. Before: 6 polys, 6 nodes. After: 5 Polys, 5 Nodes.
UT run fine, UEd too. No any crash.
------
But it is very dangerous trick.You can not revert geometry after this.
So be very careful.
Also you can produces bad geometry with a lot a fake zones.
I ended on it.

Finally I cropped terrain with brush clipping with good results.