PDA

View Full Version : Making/Combining tools through the command history


lougandidas
09-25-2004, 05:23 AM
I'm trying to make a universal "drop" or kill everything tool. I want to make a tool that drops the selection, and drops the current tool, regardless of the tool and the situation.

Playing in the command history and looking through the list of commands, I've found:

select.drop works well, but I want to add to this to kill the current tool. I can't seem to get a command for every tool to drop.

tool.drop only drops the current tool so I can't enter it to just drop everything, so it's hard to make it a universal drop.

Help is much appreciated.

kursad_pileksuz
09-25-2004, 05:58 AM
press your escape button. pressing 2 times will drop operation and selection

lougandidas
09-25-2004, 06:33 AM
Kursad, thanks. Actually, I found that I have to hit it 3 times to get to the point I want. For example, I have some polygons selected and select the element tool. If I want to drop the operation, selection and the tool, I have to hit it 3 times.

The escape button doesn't show up in the command history, history list. Is there anyway to combine this to one operation? So instead of clicking escape 3 times, just to hit it once? From there, I could move it to any key. How can I combine the operation into one button push?

kursad_pileksuz
09-25-2004, 06:46 AM
the tool is called escape itself

i tried to make a simple macro, which i call escape 3 times, but you just run the macro one time through a shortcut, but unfrotunately with current build i have it is crashing (when macro run when a tool is active) . so i reported it as a bug. but you can try it on your own . goto scripts and make a new script, enter "escape" 3 times in the script in every script line, that basically runs escape 3 times. it may crash on you or not, so do it test scenes first


i think that when you hit escape command history shows only the end result of it.

Kursad, thanks. Actually, I found that I have to hit it 3 times to get to the point I want. For example, I have some polygons selected and select the element tool. If I want to drop the operation, selection and the tool, I have to hit it 3 times.

The escape button doesn't show up in the command history, history list. Is there anyway to combine this to one operation? So instead of clicking escape 3 times, just to hit it once? From there, I could move it to any key. How can I combine the operation into one button push?

lougandidas
09-25-2004, 07:10 AM
I'm not following you totally. I thought everything was supposed to show up in the history. From there, I would just like to select the result from pushing it 3 times and assign to a key. Even when I make a macro, and select record macro, escape, escape, escape and stop recording macro, I only get the record and stop operations.

kursad_pileksuz
09-25-2004, 07:22 AM
well everything shows up, except couple of items i guess, they may want to keep some stuff invisible due to their own coding or patent . the other thing is that "escape" can be a macro itself, so it wont show as escape! if there are conditional scripting in that macro, it is quite natural that it wont show up. i am not a programmer or luxology spokesperson i am just trying to help here, so i cannot know all the technical details. or it may simply be a bug. but in its definition, it says "escape from current operation" , so it is escaping from current operation and it is showing what it is escaping from. it is logical, but again ti would have been nicer if it showed the escape first and the result. you need to think about different possiblities of matters

i found the command from list of commands. i do not have release version here, so i am not sure what commands listed in your commands tab, but you can check out yourself.
as i said , you do not create macro for that kinda operation by recording, because it does not show up in the history. you basically need to go to macro window and enter as 3 line simple macro.

lougandidas
09-25-2004, 07:44 AM
Hi. Thanks for your help. I figured out the scripting thing and adding lines. I combined escape, escape and escape and mapped them to the escape key. Got a crash too.

kursad_pileksuz
09-25-2004, 07:58 AM
i figured the crash was a bug, hopefully it will be fixed with the next patch.

jangell
09-25-2004, 12:30 PM
the tool is called escape itself

i tried to make a simple macro, which i call escape 3 times, but you just run the macro one time through a shortcut, but unfrotunately with current build i have it is crashing (when macro run when a tool is active) . so i reported it as a bug. but you can try it on your own . goto scripts and make a new script, enter "escape" 3 times in the script in every script line, that basically runs escape 3 times. it may crash on you or not, so do it test scenes first


i think that when you hit escape command history shows only the end result of it.

There is a bug where QUIET commands, such as tool.drop, would crash when used in scripts. QUIET commands are UI constructs and aren't usable in scripts, and are supposed to throw errors when used as such.

I understand the request to be able to drop any tool with a keypress and geometry selection via a keypress. I'll look into writing a script to resolve it.


To elaborate, QUIET commands like tool.drop are wrappers that execute other commands, such as the one that specifically drops that tool.

-- Joe

CB_3D
09-25-2004, 12:47 PM
In other word, for now scripts canīt execute scripts?!

lougandidas
09-25-2004, 12:52 PM
Thanks Joe. I'm looking forward to a script or just stick something in the next build. Until then, it looks like I have to get used to hitting escape 3 times. Thanks for the explanation.

I also hope that you guys decide to publish what bug fixes were resolved between updates. I think this is something that users would want, especially when they take the time to report a bug and it is found to be a bug.

jangell
09-25-2004, 01:11 PM
In other word, for now scripts canīt execute scripts?!

No, scripts should be able to execute scripts without problems (scripts are not QUIET commands; only a small subset of commands are QUIET, such as tool.drop. If you execute a QUIET command, it doesn't show up in the history, but the commands that it executes show up in the history instead). That said, there might be an issue executing a perl script from within another perl script in the current version.

-- Joe

CoolDuck
09-25-2004, 02:09 PM
Good idea! I'd also like a tool that kills all selection and selected tool. I'm used to the maya way where u don't have to drop tools and such. Just click outside the mesh and selection is dropped.

kursad_pileksuz
09-26-2004, 03:12 AM
thnx Joe, i hope we will get a solution to the matter soon through another script maybe.
can you also list those quiet commands? so we would know what not to call within macro?

thnx

jangell
09-27-2004, 05:55 PM
thnx Joe, i hope we will get a solution to the matter soon through another script maybe.

Here's a perl script that effectively issues "escapes" twice. First it the deselects all vertices, polygons edges and materials, then drops the tool by using select.nextMode, then goes back into whatever geometric selection mode you were previously in. Note that the geometric selection dropping is different than that of the escape command which, only drops the current selection type. Of course it is possible to change the script to operate more like escape if desired.

I wasn't able to get a case where I needed to hit escape 3 times. If you give me specific repro steps I can see about modifying the script to support the third hit as well.


--------------- CUT HERE --------------
#! perl
#
# EscapeAll.pl
# Written by Joe Angell, Luxology LLC, September 2004
#
# Drops the current tool and all geometric selections.
#

# Remember the current selection type
my $type;
if( lxq( "select.typeFrom {edge;vertex;polygon;item} ?" ) ) {
$type = "edge";
} elsif( lxq( "select.typeFrom {vertex;edge;polygon;item} ?" ) ) {
$type = "vertex";
} elsif( lxq( "select.typeFrom {polygon;vertex;edge;item} ?" ) ) {
$type = "polygon";
} elsif( lxq( "select.typeFrom {item;vertex;edge;polygon} ?" ) ) {
$type = "item";
}

# Drop all of the geometric selections
lx( "select.drop edge" );
lx( "select.drop polygon" );
lx( "select.drop vertex" );
lx( "select.drop item" );

# Drop the current tool by hackily using select.nextMode
lx( "select.nextMode" );

# Switch the the previous geometric selection type
lx( "select.type {$type}" );

# Done
--------------- CUT HERE --------------

can you also list those quiet commands? so we would know what not to call within macro?

Sure. All QUIET commands still show the commands they execute in the history. Note that some of these quiet commands have loud counterparts.

attr.formPopover
attr.formPopoverSelected
layout.saveQuiet (try layout.save)
viewport.setScheme (try viewport.scheme)
clip.load (try clip.addStill)
clip.loadSequence (try clip.addSequence)
openHelp
tool.activate (try tool.set)
escape
tool.drop (try tool.set for each specific tool)
eval
scene.export (try scene.saveAs)
scene.load (try scene.open)
plugin.load (try plugin.add)
config.export (try config.exportDialog)
config.load (try config.import)
falloff.axisAutoSize (try tool.setAttr)
falloff.autoSize (try tool.setAttr)
falloff.reverse (try tool.setAttr)

-- Joe

kursad_pileksuz
09-27-2004, 06:24 PM
Hey Joe thank you!!! that was helpful

lougandidas
09-28-2004, 03:21 AM
Thanks Joe, I'll give it a go.

lougandidas
09-28-2004, 01:20 PM
Joe, thanks. It worked out fine. It took me a couple minutes to figure out how to run the script and what do do with it. For people that don't know, I just made a folder called scripts and put it in the luxology > modo folder and went system> run script and found the script. I previously copied and pasted Joe's script in a text file and named it escapeAll.pl. From there, I fired the command and right clicked it in the command history > history area and mapped it to a key. Pretty simple.

I've since modified it a bit by combining it with a twist. I find myself usually wanting to be in polygon mode, so I made my "own script". I just went to command history > scripts and made a new script that called your script and then select.type "polygon" and mapped both commands to a key. Perfect.

kursad_pileksuz
09-28-2004, 06:23 PM
now that is what we are talking about here :)

Joe, thanks. It worked out fine. It took me a couple minutes to figure out how to run the script and what do do with it. For people that don't know, I just made a folder called scripts and put it in the luxology > modo folder and went system> run script and found the script. I previously copied and pasted Joe's script in a text file and named it escapeAll.pl. From there, I fired the command and right clicked it in the command history > history area and mapped it to a key. Pretty simple.

I've since modified it a bit by combining it with a twist. I find myself usually wanting to be in polygon mode, so I made my "own script". I just went to command history > scripts and made a new script that called your script and then select.type "polygon" and mapped both commands to a key. Perfect.

h4sh
10-23-2004, 04:02 PM
q also drops the tool. not selection though

there must be a way to combine it with select.paint to drop selection. but select.paint works only interactively (?)

-------
never mind I see it's solved

CGTalk Moderation
01-19-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.