Page 1 of 1

duplicated project custom button

Posted: 17 Jul 2006, 22:06
by malcooning
how can I make a button that duplicates the current project I'm working on (i.e. reads the project size and opens a new one with these dimensions)?

or alternatively, a button that selects the whole project, and then applies a Crop on it (which'll automatically open the cropped part in a new project)?

Cheers.

Posted: 18 Jul 2006, 07:28
by Manuel
Here is a script that creates a new project with the same size.
This script doesn't recreate the layer structure.
Copy the script in a text file with .grg
Assign it to a custom panel button.

Code: Select all

// new project same size
Param none

tv_ProjectCurrentID
id = result
tv_ProjectInfo id
parse result name width height ratio framerate fieldmode startframe 
NewName = "Vive_les_tortues"
tv_ProjectNew NewName width height ratio framerate fieldmode startframe 
If you use always the same size, you should learn about templates. See the user manual. :)

Re: duplicated project custom button

Posted: 18 Jul 2006, 09:38
by fanany
malcooning wrote:how can I make a button that duplicates the current project I'm working on (i.e. reads the project size and opens a new one with these dimensions)?

or alternatively, a button that selects the whole project, and then applies a Crop on it (which'll automatically open the cropped part in a new project)?

Cheers.
hi welcooning,

- a) if you want to open a new EMPTY project but with the same size/framerate/... than your original,
the simplest way would be to use the "template" feature.

- b) if you want to get a real clone of your original project, with its whole content,
you can try this "workaround" button (see pict),
it should give you 2 projects opened, your original (ex: "MyProject.tvp"),
and a clone, (named "MyProject.tvp -Modified- 0"), the new current one.

oh, here's the dupli_proj.grg script :

Code: Select all

PARAM none

tv_GetProjectName
mycurrentproj=result

	tv_GetWidth
	W=result
	tv_GetHeight
	H=result

tv_ResizePage W H 1

tv_LoadProject mycurrentproj
what it does : modify proj + re-load original,
warning: it's time consuming when the project is big ...

tell me if it answers your need.
:)

Posted: 18 Jul 2006, 10:44
by malcooning
Thanks for your replies.

Manuel,
the script clones the dimentions of the project only, but not copies the content (either layered or flattened).


Fanany,
The script seems to modify the project (by this I mean that it adds to the title the word 'modified'), but all this happenes within the same project, it does not open a new one. And then, setting Key: project: Previous it focuses on the previous project of course, but that's all. am I doing something wrong?

Posted: 18 Jul 2006, 12:20
by Manuel
If you want to duplicate the project, with it's content, you can use the resize function, assign it to a button. Though you will need to hit OK as an extra step.

Posted: 18 Jul 2006, 12:46
by malcooning
good point. It's simple and straight forward. Thanks.

I actually trying to something a bit more with that. I want to merge the visible layers, and then create a duplicate (via resize I guess) of the merged visible layers only, discarding of all the unvisible layers. And I want to do that whilst leaving the original project intact.

Or, is there a way to create a snapshot?

Any idea?

Posted: 18 Jul 2006, 12:48
by fanany
malcooning wrote:Fanany,
The script seems to modify the project (by this I mean that it adds to the title the word 'modified'), but all this happenes within the same project, it does not open a new one. And then, setting Key: project: Previous it focuses on the previous project of course, but that's all. am I doing something wrong?
the script's last line :
tv_LoadProject mycurrentproj
load the original project again,
so, at the end of the process, you should obtain both projects opened : the modified and the original,
at least it's what it does here...
as usually, check you haven't "space" or other illegal character in the project "full-path-name",
(it could be the cause you got only the modified)...?

Posted: 18 Jul 2006, 13:22
by malcooning
I managed to get the desired result sans-script in the end. It certainly is the longest custom button list I have made so far, and it uses all the available spaces. It look a bit rediculous, but it open a new identical project, all the visible layers are merged and the not visible ones discarded. It then has one new blank layer on top, ready to be drawn over.

Posted: 18 Jul 2006, 13:43
by ZigOtto
nice set of icons, ... and nice drawing too! 8)

is that supposed to be animated?
because if it's only still art, I think we can get the same result by a simpler way (by using tv_ImageToClipBoard & tv_ImageFromClipBoard)

Posted: 21 Jul 2006, 11:46
by malcooning
Thanks,

yeah, it's supposed to be animated, so the button takes a project that might be messy with all kinds of sketching and guids, and creates a new draft, with your progress so far. I guess that for the way that I work it is a function I seem to be using very often.
TVpaint is great on that sense.