EditorTools

Tutorials and discussions about Mapping - Introduce your own ones!
User avatar
sektor2111
Godlike
Posts: 6438
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: EditorTools

Post by sektor2111 »

Red_Fist wrote: Wed Aug 26, 2020 5:16 am Gotta be a place to get that data, like, right click, see dimensions, simple right ? LOLzzzzz
Then find that place and let us know about it. In other hand I don't get how do you find from Editor what is about: Cube, "sphere", other cylinder, etc. in data terms cloning human eye without Copy-Pasting it as text you cannot get anything in Editor (unless you do an actor and pasting clipboard as script... :) )
Perhaps a tool like that Texture aligner might be good if anyone else has a bit of C++ skill or whatever advanced programming language for capturing Editor content and reporting some data.
Chamberly wrote: Wed Aug 26, 2020 5:23 am Sektor2111, you know a lot of us really like a simple measure viewing tool of such brushes!
I don't understand what is that hard to figure in pictures which I was showing. Add two BlockAll, measure distance (then press delete button), it takes a few seconds for a task which I'm not usually using. If you want to find if place is good for gaming just try adding a monster (Behemoth). If successful, delete monster then.
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Maybe number on wireframe lines will be good. but even in this case it can be useless information.
Maybe size of escribed cube also can be useful for compilcated brush.
But in general case nobody know what you want measure. So point it by ClipMarkers or Actors and measure distance.
I prefer ClipMarkers because they have line connected it, erased on save, and good visible on planar views. Also can be easy added, without switch to it in Actor Browser.

About Texture Aligner: I need examples of brushes which you want align. And info in what way you want align it.
T3D form of brush in code tag here will be enough.
Red_Fist
Godlike
Posts: 2201
Joined: Sun Oct 05, 2008 3:31 am

Re: EditorTools

Post by Red_Fist »

Just cubes-rectangles. Say I put in a sidewalk and I had to make it 400 wide, 16 high and 5,892 long.

Ok, so, you come back to the map two weeks later but need to add another sidewalk, same length, I have keep changing the cube builder brush to reach that same 5,892 and look at the grid, move brush see how many units (grid 1 always for me) then count the grid and change the number till I get it the same. (trial and error)

Other shape brushes don't matter.

But it also has uses to see if you can fit other brushes in a room, only if I knew how big the room is first without trial and error.
So if I applied polys to brush, I could just click and see the size. It doesn't have to be down to the tenths, even if it shown a rounded number I could do the size much faster.
Binary Space Partitioning
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Copy polys to brush and drag builder brush to somewhere is not an option?
Or make simple cube, switch to vertex edit and drag entire plane of brush to match same position?
Red_Fist
Godlike
Posts: 2201
Joined: Sun Oct 05, 2008 3:31 am

Re: EditorTools

Post by Red_Fist »

Vertex editing screws up the symmetry of the pivot.

If I knew the size of the room, but wanted a brush on the floor with a 32 unit space on each side, I could just subtract 64.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6438
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: EditorTools

Post by sektor2111 »

Nice thing the option for moving red builder in front of camera, I needed this feature in the past...
I think you should have Green color here...
I was doing similar lamps/boxes, using brushes and I often needed to move red builder from previous room doing more moves, now it's simple as a pie, builder is brought closer to desired location being more easy to be placed in desired spot. I'm not sure how well is alignment held by Goblin but... at least I don't need to scroll map all day long.

You are really doing good stuff for Editor...
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

It is not just move brush. it is snapped move brush. With respect current grid settings. So all must be fine with alignment.
User avatar
sektor2111
Godlike
Posts: 6438
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: EditorTools

Post by sektor2111 »

If I'm looking at scripts, I agree. If I take in account what does Edy Goblin aka Unreal Editor with some brush movement maybe it's needed more attention because all grid rules might fly on Window when map has thousands of brushes, I know what I'm saying... I even did an experiment with a perfect t3d file, results were not exactly as expected...
GridAlignExperiment
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Float features. But UEd merges points that are closer than 0.3uu. So this is usually not a problem.
Red_Fist
Godlike
Posts: 2201
Joined: Sun Oct 05, 2008 3:31 am

Re: EditorTools

Post by Red_Fist »

What about this, you know where you type in the number for the sizes making a cube brush.

If it can change the brush size, wouldn't there be a way to click a brush and do the reverse of what typing in the number does then grab that data on the fly ? :noidea
Binary Space Partitioning
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Usually action not reversible. x*x is easy, but get x from x*x is not.
When you input numbers they not stored and use for generate vertex coordinates. After that you can drag it anyhow. So, in general, you can not restore size of cube. It can be even not cube anymore.
User avatar
sektor2111
Godlike
Posts: 6438
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: EditorTools

Post by sektor2111 »

Okay, I used a sequence imported from here for making a general grid-alignment in MapGarbage not only rounding coordinates - using these lines from here:

Code: Select all

if (GridSize.x != 0) loc.x = int(int((loc.x/GridSize.x) + 0.5)*GridSize.x);
...
For some reason, a few PathNodes (those selected ones for grid-align) were constantly being moved on whatever axis at repeating command. I did not understood this behavior so I touched a bit codes - I got some good alignment for brushes too using these:

Code: Select all

			if ( GridSize.X != 0 )
			{
				log (A.Name@"initially had X ="@Loc.X);
				if ( int(Loc.X/GridSize.X) != Loc.X/GridSize.X )
					Loc.X = int(int(Loc.X/GridSize.X) + 0.5)*GridSize.X;
				log (A.Name@"will have X ="@Loc.X);
			}
.... //and so on with Y and Z.
Last multiplication do looks like already uses an integer so I excepted re-rounding last multiplication. If some brushes were needing another grid (grid was 4 for them), parameter GridSize can be defined and if this is 0,0,0 is will be acquired from ini as it was in original code. If user wants another grid this can be customized and it will stay as user wants.

Anyway, because I'm happy about this aligning solution, full credits goes at Buggie.
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Code: Select all

int((loc.x/GridSize.x) + 0.5)
mean divide and round by math rules.

Code: Select all

int(loc.x/GridSize.x) + 0.5
Mean... mean... IDK what this mean.
Divide, truncate to int, add 0.5 with conversion to float? - pointless.

Example:
loc.x = 9;
GridSize.x = 16;

Code: Select all

loc.x = int(int((loc.x/GridSize.x) + 0.5)*GridSize.x)
Go: Loc.x = int(int((9/16) + 0.5)*16) = int(int(0.5625+ 0.5)*16) = int(int(1.0625)*16) = int(1*16) = 16

Code: Select all

Loc.X = int(int(Loc.X/GridSize.X) + 0.5)*GridSize.X;
Go: Loc.x = int(int(9/16) + 0.5)*16 = int(int(0.5625) + 0.5)*16 = int(0 + 0.5)*16 = int(0.5)*16 = 0*16 = 0

Obviously right answer is 16, because 9 is bigger from half of grid cell (which is 8 ).
User avatar
sektor2111
Godlike
Posts: 6438
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: EditorTools

Post by sektor2111 »

I don't know how was doing math this engine but... I pushed align option and I saw Node moved, and then trying aligning Node again. Nothing was moved any more since it was already aligned, in exchange previous code was pushing node 8 UU constantly all time when option was called moving it away - I have to admit I should do a very careful check at syntax because perhaps I was writing something wrong. Anyway things are not going to stay like that, I will do more other checks with all sort of actors.
Then a good code can be this one, working fine:

Code: Select all

Loc.Y = int((loc.Y/GridSize.Y) + 0.5)*GridSize.Y;
I don't think are needed two INT calls, one INT should return fixed value when it's multiplied (unless grid has a funky value) - perhaps a double INT won't cost a fortune to be used...
Buggie
Godlike
Posts: 3162
Joined: Sat Mar 21, 2020 5:32 am

Re: EditorTools

Post by Buggie »

Hmm. Original code produce not stable results? Try this:

Code: Select all

loc.x = int(int((loc.x/GridSize.x) + 0.5)*GridSize.x + 0.5)
Vector use float. So second rounding can produce better results if addition make some float error.