Sauerworld Forum

selectface command

Salatiel

  • ***
  • 116
  • +25/-1
    • Projects by Salatiel
selectface command
« on: January 04, 2018, 02:51:44 PM »
I really miss a command that selects the faces of a previously selected cube
/selectface N (N is the face number)

 Why would it be useful?
 -You could bind a key to select a back face of a cube, without having to move there to select
- It would be possible to create loop of cubes in different positions instantly using something like:
draw = [
    sleep 10 [selectface 1 ; loop i 6 [universaldelta -1]]
    sleep 20 [selectface 2 ; loop i 6 [universaldelta -1]]
]

^ Then imagining that 1 is the front face of the cube, and 2 the left side, this would result in a curve with 10 cubes...  :o



Maybe if it could depend on the position of the player's camera would be better

Here is a gif, colors are just to exemplify:


(if this command already exists, ignore this suggestion and please tell me what it is  :P)

-Update-
Check out this function and a few other new commands to move the selection:
http://sauerworld.org/forum/index.php?topic=574.0
« Last Edit: July 05, 2019, 12:32:32 AM by Salatiel »
@Salatiel#5274

Salatiel

  • ***
  • 116
  • +25/-1
    • Projects by Salatiel
Re: selectface command
« Reply #1 on: November 07, 2018, 03:58:24 PM »
After a while trying to do this on my own, I came up with a reasonable result:

Code: [Select]
void pushface(int *dir, int *pface)
{
    if(noedit(moving!=0)) return;
    int s = *dir;
    sel.o[*pface] += s*sel.grid;
}
COMMAND(pushface, "ii");

Is a variation/modification of the Pushsel command, and should be added in src/engine/octaedit.cpp
This does not select the face, but moves the selection to the chosen direction.

arg1: -1 || 1 (add or subtract arg2)
arg2: 0 = X || 1 = Y || 2 = Z
« Last Edit: November 07, 2018, 04:00:20 PM by Salatiel »
@Salatiel#5274