PDA

View Full Version : copy+paste+select+pasted+move tool in one click?



Danner
03-18-2011, 04:32 PM
In modeler, let's say i want to add another light fixture just like the one I made. I select the geometry, press Ctrl C to copy it, Press T to move it, ctrl V to paste the original back in it's place.

I seem to be doing this sequence a LOT when I work. It just seems silly to be having to use 3 shortcuts when I could be using one key.. anybody know of a lscript or a .p that does this? (copy, paste, keep one of the two selected, change to move tool)

The paste tool sort of does this.. but it seems to be unpredictable with the Z axis, sometimes it's fine, sometimes it pastes things at different heights. Maybe I'm using it wrong *shrugh*

lardbros
03-18-2011, 05:00 PM
Was going to say the paste tool...

Doubt you're using it wrongly, but it does tend to paste from the position you chose the last object to paste... as far as I can tell the paste tool does exactly this.

I'm sure you know, but right-clicking keeps pasting the same object wherever you click. The if you left click it moves the last pasted object where you want. You can choose where you want it, and then right-click to paste and it will end up at the same height if you do it from the top view... it works pretty well as far as I can tell!

Danner
03-18-2011, 05:49 PM
I do use it, specially when I need to do several copies, but for just one.. or two it just gets me into trouble because as I said it sometimes pastes fine on the viewport I'm cliciking but looking at it from another viewport it's at a different height from the original.. really odd. Anyway as useful as it is (even if it worked well all the time) I still have to use one extra step (copy) from the script I want =)


Think of it as duplicating an object in layout (or Unity or pretty much any other 3d app..)

lardbros
03-18-2011, 05:57 PM
Oh, so you want it to do the copy bit as well?

Like I said before though, if you 'paste tool' an object, you can use the Left Mouse Button to move the object about as if you have the move tool selected. I think I'm being stupid, but I'm not sure of the benefit of using your plugin idea over the paste tool... sorry. :(

Danner
03-18-2011, 06:03 PM
I think I'm just not explaing myself too well. =)

There would be two differences,

1, The copy aspect into the script would work better when you need to copy and paste different things, and not a ton of the same things. (copy this lamp, then this chair, then this curtain..) Paste tool is great for lots of copies, even at different sizes from the original, but for multiple thing you'd need to hit copy again.

2. It has been very frustrating to be on the top viewport, select a lamp, use the paste tool, just to find out (after pasting for a while) they are not at the right height when I go to the side view. I don't want to always work seeeing all 4 cuadrants..

lardbros
03-18-2011, 06:09 PM
Right, I get ya!! So, mainly if you were copying and pasting an object once or twice, and then another a couple of time... I can see how it could get tedious, depending on how often you were doing that... have you checked any Plugin databases that may have something?

Danner
03-18-2011, 06:11 PM
Yeah I checked.. Might have to bug a ls guru on this one.

lardbros
03-18-2011, 06:14 PM
Yeah, do it... and let me know if they get it done... it may even be a good Lscript to have a go at as a first time Lscript... it doesn't sound too tricky. But then I'm not a coder :D

Danner
03-18-2011, 06:16 PM
I actually thought about learning LS just for this.. but I'm working 15 hour days lately and learning Javascript for Unity..

Rabbitpenny
03-18-2011, 07:09 PM
For your cirumstance, I think a better approach is to select, copy, hide selected, paste, move, then unhide...shouldn't have that problem.

However for macros like this, I have a Belkin n52te game key pad. It's easy to program on the fly (takes seconds to add a macro). In fact, I have a preset on the pad such that when modeling, my hand never leaves the key pad.

evenflcw
03-18-2011, 09:04 PM
By Danners request. (Thanks)

A quick script. Took it as far as I care to within lscript. It's just a replacement for the regular paste command. When you run it, it pastes and changes the selection to the pasted geometry. It will select either polygons or points depending on some logic. Tell me if you think the logic is sound or dumb.

Use at on risk. Feel free to modify (preferably add yourself to the list of authors or just erase my name).

PS1. For you budding lscripters, what it does is this:
1. Gets the point and polycount before and after paste.
2. Checks if any of the new point is free floating (no polygon attached).
3. If free floating point, it switches to select point mode, else remains to select polygons.
4. Lastly it selects elements with indices between the count before and after paste (see step 1).

PS2. maybe I should write that feature request for a standardized workflow (for all functions in LW, in particular those creating new geometry), which, if it had been implemented this would never have been an issue. Basically it goes... Rule 1. Always(!) select new geometry so it can be manipulate immediately by the user.

PS3. The logic, step 2 above, makes it abit on the slow side. I might alter it somewhat later.

Danner
03-19-2011, 05:25 AM
I hope this is not too confusing, it's hard to explain worflow issues without actually seeing what is going on.

Thank you for the quick response and for the script, I started playing with it, and I like it! Whith your script I can paste something, move it around rotate it etc. And when I'm done I just paste another, it gets automatically selected so I can modify that one too. It's great for coping parts of an object too, you select the piece you want, copy it, use PasteAsSelected and the new geometry is selected and disconected from the original! very cool.
I used to use a script to copy parts of an object called "copyundopaste" but it was odd to use because you had to move the piece out of the way before using the script. PasteAsSelected makes it obsolete.

Using simple paste doesn't work because the new geometry would not be selected and I'd have duplicate geometry and no easy way to select it to separate it.

This new script is not exactly what I was after but it's so much better than simple paste, it's more reliable than the "paste tool" too, and has the plus of selecting the new geometry (well it's weird how the "paste tool" works.. you modify something that is not marked as selected but once it's done you have the original selected not the modified one..)

Now if PasteAsSelected was turned into CopyPasteAsSelected then it would be exactly what I had imagined ;o)

evenflcw
03-19-2011, 09:47 AM
Yea... I thought maybe I ought to write a copy-paste-select as it would mean you'd always continue from were you left off rather than at the start everytime (first copy call). The reason I didn't is because handling the case were you copy with nothing selected is sortof dubious, as it allows both polygons and freefloating points to be pasted... so what should it select, points or polygons? But I guess in most situations the user will have an explicit selection, so just disallow the implied selection and dubious case is solved.

Anyway. Try attached.

Thanks for the input. It is appreciated. What most developer dislike are short statements like, "it works", "it doesn't work", "make it work like software x feature y". A good request/review include lengthy description and motivation, even for seemingly obvious things. Just like that!

Use at on risk. Feel free to modify (preferably add yourself to the list of authors or just erase my name).

EDIT: Download from here (http://people.dsv.su.se/~dan-dulb/evenflow3d/index.php).

Danner
03-19-2011, 10:13 AM
I gave the script a short test session..

I can't understand why nobody came up with this before!

CopyPasteSelect works great! just like using Duplicate on maya or Unity, I even bound it to the same shortcut haha!

The paste one is a keeper too, I think it will replace the simple paste command completely, I can't see why the original paste doesn't work like this.

Beers are on me tonight Dan :thumbsup:

evenflcw
03-19-2011, 10:41 AM
Cool. Why not before. I think there might have been one or two over the years. Not every script/plugin are in a searchable database somewhere. Certainly people have complained about the copy-paste workflow, in particular that you move the original rather than the clone.

Duplicate is a better name (shorter and accurate enough). Maybe change?

Danner
03-19-2011, 10:44 AM
Sounds good.

evenflcw
03-19-2011, 11:08 AM
Put it up on my page. Thanks! :)

lardbros
03-19-2011, 11:46 AM
Thanks to you both... great script and great advice on what you were after Danner! :)

evenflcw
03-19-2011, 12:33 PM
The script was just updated (to v1.1). There was a bug were if you had polygons selected, but were in point mode, it would consider the points of the selected polygons as explicitly selected. It also now sends an info message on every operation to make it a little bit easier to see when it's done something.

It's still slow though because of the way it selects the new geometry. I'll see if I can figure out some other way to make that faster. Problem is finding a way that won't interfere with other things (like hiding). I might end up converting it to a plugin for the speed gain.

Thanks for the beers Danner! :beerchug:

dwburman
03-19-2011, 02:05 PM
It'd be nice to have a duplicate-move tool. Select geometry invoke the duplicate-move tool, drag the selected geometry to it's new location. The original geometry is still in place, but new geometry is selected and at your pointer tip.

Basically, it's like alt-dragging in other graphics software (like Illustrator) to make a duplicate.

evenflcw
03-19-2011, 02:36 PM
Honestly, that doesn't sound too far off from the Duplicate script to me. From your description, the only practical difference seems to be what buttons you're clicking to create a duplicate, Alt+click vs the custom hotkey you assigned to the Duplicate script (Ctrl+D FTW). If you already have the move tool active, the number of user actions are the same, 1. Correct? Not correct? (I'm not intending to defend the script or slam the idea, but merely discus and understand the idea, it's motives and added value (and costs).)

Then there is the fact that tools (meshedittool;layouttool) are the most complex plugin type, thus requiring abit more work (although at times it can be faster than hacking together a script that goes beyond what lscript was designed for). And you say "move", but there is a 99% chance that either you or someone else will soon say they also want to rotate and scale the duplicate within the same tool. So it ends up overlapping already existing functions, and it's the most fundamental functions in the program. To me that signifies that you don't really want a plugin, you want a whole other program, with a different design!? (There is nothing wrong with that though.)

I'll agree that Alt+drag and the like feel very natural and fluid after a while.

jeric_synergy
03-19-2011, 05:51 PM
Basically, it's like alt-dragging in other graphics software (like Illustrator) to make a duplicate.
Make the hotkey for this "ALT+T" and badda bing badda boom.

Oedo 808
03-19-2011, 07:47 PM
I've looked through Modeler's tools before trying to find this functionality, some of the names makes you think that some has thought about this area, but somehow missed the most obvious implementation.

Anyway, just tried it, works great, I too find that this is a sequence I repeat a lot when modelling, so this is much appreciated. :thumbsup:

jeric_synergy
03-19-2011, 08:40 PM
It'd be nice to have a duplicate-move tool. Select geometry invoke the duplicate-move tool, drag the selected geometry to it's new location. The original geometry is still in place, but new geometry is selected and at your pointer tip.
That's what the Paste Tool does, but as pointed out, it's buggy.

So, a fixed PT would meet those criterion.

You CAN use evenflcw's Duplicate and just STAY in Move mode, so that's very nearly as convenient, IMO. It's like Extend in that respect.
+++

evenflcw, is DUPLICATE the current final version of this? I'm planning on making a blog post about it.

And is "PasteAsSelected" going to be up on your page too? I found it a nice alternative to "Duplicate"-- another arrow in the quiver.

Excellent work! :thumbsup:

evenflcw
03-19-2011, 09:01 PM
It's as final as final gets until I release another version of it. :)
Basically, yes it's final, until somebody reports a bug or sends a request I can and care to fix or implement.

Btw, I'm finally starting to get what dwburman and chunderburger are on about. That is certainly alot of work, especially to recreate all the snap options Maya has built in. Doesn't Pictrix have something, atleast for the advanced transforms? LWCAD maybe?

daforum
03-20-2011, 08:06 AM
Thanks for creating this script :) Very,very useful....

....(and yes, why didn't LightWave have this years ago!?)

dwburman
03-20-2011, 10:00 AM
Well, I liked the idea of alt-drag, but then took a step back from that thinking that in order to do it in LW, you'd have to change something fundamental b/c 3D is more complicated than 2D. When I took the step back, I ended up where you already are... well in a slightly worse place than you already are because it'd be yet another tool. :foreheads:

I'd like a modifier-key+drag function, not a run-script THEN drag function, or copy then select another tool then drag function. I want it to be one action instead of two actions. Ideally it'd be a modifier key that worked with all the other tools (move, scale, rotate, etc), and I also want it to be a built-in feature of LW, not a plug-in. A repeat operation button would be nice for quickly making arrays would be nice too. Is that too much to ask? :D

I'll have to d/l your scripts and try them out. They sound much better than the native LW workflow. I've been with LW so long that I sometimes don't notice how needlessly clunky some things are.

Thank you for writing this scripts.

jeric_synergy
03-20-2011, 11:37 PM
The paste one is a keeper too, I think it will replace the simple paste command completely, I can't see why the original paste doesn't work like this.
Dodgy reminded me that the Paste Tool pastes on the... wait, here's what he said:

The paste tool uses the centre of the other view port to determine the clone's position in that view, so the best thing to do is frame the selection to be pasted, then zoom out to paste your clones, which will paste them level with the original. After you've pasted once, it uses the clone's centre, so you could paste once, move that clone to a different height, then paste more which will stay at that height.

So, a little guidance into using LWM's Paste Tool. However, I think evenflcw (http://people.dsv.su.se/~dan-dulb/evenflow3d/index.php)'s "Duplicate" is a more natural and intuitive tool: use each for their own virtues.

Matt
03-21-2011, 02:17 AM
What would be nice is smart duplicate, like in Maya.
You duplicate a mesh and then transform it using ctrl+d to duplicate and STD msr tools then you repeat the duplication of the duplicate with previous transformation using shift+d.

This is how Adobe Illustrator works, there is a command called "Transform Again" which repeats the last transformation. Whether that is a simple move, a move and copy or a more complex transformation.

It's very useful.

Danner
03-21-2011, 02:20 AM
@ Jeric

aha! I was indeed using it wrong, but the extra setup needed seems exactly what I'm trying to get away from. On the quote I was refering to the Ctr V kind of paste, and to the first script Dan made, one that would just paste and select pasted.

jeric_synergy
03-21-2011, 01:01 PM
There's needs for all the different kinds of Paste, I'd say:


Paste (right where you came from) AKA 'regular paste'
Paste where I'm pointing at, AKA "the Paste Tool"
Paste where you are and be selected, AKA "Duplicate"
Paste where you were when the user hit "Copy", AKA "PasteAsSelected".

I hope evenflcw puts up "PasteAsSelected" right alongside "Duplicate", since they both are useful.