duplicated project custom button

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

duplicated project custom button

Post 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.
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post 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. :)
Manuel
fanany
Posts: 89
Joined: 04 Apr 2006, 22:00
Location: escalierA

Re: duplicated project custom button

Post 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.
:)
Attachments
CloneProj_Button.png
CloneProj_Button.png (4.12 KiB) Viewed 24908 times
Clone_Button.png
Clone_Button.png (488 Bytes) Viewed 25292 times
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post 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?
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post 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.
Manuel
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post 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?
fanany
Posts: 89
Joined: 04 Apr 2006, 22:00
Location: escalierA

Post 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)...?
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post 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.
Attachments
screen after.jpg
screen after.jpg (193.89 KiB) Viewed 23216 times
screen before.jpg
screen before.jpg (182.13 KiB) Viewed 23218 times
duplicate project.jpg
duplicate project.jpg (24.02 KiB) Viewed 24881 times
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Post 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)
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post 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.
Post Reply