Multiple frames animation with solutiontime

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

Xico
Experienced user
Posts: 12
Joined: Fri Feb 01, 2008 2:31 am
Location: Paris

Multiple frames animation with solutiontime

Postby Xico » Fri Feb 01, 2008 9:35 am

hello

I've got a problem with exporting animation of multiple frames using solutiontime.

I installed the addon proposed there : http://www.tecplottalk.com/viewtopic.php?t=22 by scottf and it's very convenient for an usage in the tecplot interface (TEC360v2006).

But when I try to export my animations of these synchronized frames with the dialog box of the interface, it only exports an animation of the first frame.

So I tried to run a macro as I did before apparition of the solutiontime approach.

#!MC 1000
$!VARSET |ZONE| = 1
$!FRAMECONTROL PUSHTOP
$!ACTIVEFIELDZONES = [|ZONE|]
$!FRAMECONTROL PUSHTOP
$!ACTIVEFIELDZONES = [|ZONE|]
$!REDRAWALL

$!EXPORTSETUP EXPORTFORMAT = AVI
$!EXPORTSETUP IMAGEWIDTH = 400
$!EXPORTSETUP EXPORTFNAME = 'E:\animation.avi'
$!EXPORTSTART
EXPORTREGION = ALLFRAMES


$!VARSET |NSLI| = 401

$!LOOP |NSLI|

$!VARSET |ZONE| += 1

$!FRAMECONTROL PUSHTOP
$!ACTIVEFIELDZONES = [|ZONE|]
$!FRAMECONTROL PUSHTOP
$!ACTIVEFIELDZONES = [|ZONE|]
$!REDRAWALL

$!EXPORTNEXTFRAME

$!ENDLOOP


$!EXPORTFINISH

but now I don't by what I can replace $!ACTIVEFIELDZONES to activate sequentially each time step in all frames...

Is it possible to have this equivalent feature?

thanks

User avatar
aritzmann
Jedi Master
Posts: 127
Joined: Mon Nov 20, 2006 2:26 pm
Location: Princeton, NJ
Contact:

Re: Multiple frames animation with solutiontime

Postby aritzmann » Fri Feb 01, 2008 10:27 am

Hi,

The solution seems to be that you should try using the extendtimemcr add-on that is also provided by Scott F. This addon allows you to specify actions such as going to the next time step. Please see more documentation at: http://www.tecplottalk.com/addons/ExtendTimeMcr/

This addon can be obtained from the link above, and it is included with the distribution of Tecplot 360/Focus 2008.

Best Regards,

Andrew
Andrew Ritzmann

Xico
Experienced user
Posts: 12
Joined: Fri Feb 01, 2008 2:31 am
Location: Paris

Re: Multiple frames animation with solutiontime

Postby Xico » Wed Mar 05, 2008 8:42 am

Thanks for this solution!

Sorry for the delay of the answer but I tested the addon you recommended me and it works well for what I wanted to do.

I've got another question which is not exactly related to solutiontime but with animation in general. I want to write the time of each time step on the frame so I use the addon and !ATTACHTEXT like this (in a loop over timesteps of course) :

$!ADDONCOMMAND ADDONID='ExtendTimeMCR'
COMMAND='QUERY.TIMEATSTEP |LOOP| CURTIME'
$!ATTACHTEXT
ANCHORPOS
{
X = 10
Y = 95
}
TEXT = "Timestep = |CURTIME| s "

$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK ADD
X = 3.10309278351
Y = 1.26030927835
CONSIDERSTYLE = YES
$!PICK CLEAR

The second part is necessary to clear the text before the next time step. Its not very elegant but it works well except one major point. If I change the layout with a frame which has not the same size I need to specify manually the new pick position because the location is in inches (which is different from the location of ANCHORPOS which is in X-value). Do you have a tip to write a nicer macro for this display?

Thanks

User avatar
aritzmann
Jedi Master
Posts: 127
Joined: Mon Nov 20, 2006 2:26 pm
Location: Princeton, NJ
Contact:

Re: Multiple frames animation with solutiontime

Postby aritzmann » Wed Mar 05, 2008 10:24 am

Hi,

Thanks for asking this question since it is a matter of good macro style and is something that a lot of people need to know. The best way to delete a text box is not to use the simple $!PICK statment that you used in your macro, but instead to use a $!PICK command that adds all text within a rectangle. In this way you can pick what you want and get rid of it.

The syntax is as follows (still not elegant, but better than what was there previously).

If you are willing to get rid of every text box, then you can use the following:

$!PICK ADDALL
SELECTTEXT=TRUE
$!PICK CLEAR

If you need to be more specific, then the following is a bit messier, but still effective;

$!PICK ADDALLINRECT
SELECTTEXT=TRUE
X1=2.5
X2=3.5
Y1=.8
Y2=1.6
$!PICK CLEAR

This syntax can be refined to pick as small a region or as large a region as you can handle. It has the benefit of working properly within a larger range of frame sizes, but it can defeat itself just like the version you had previously. The best would be to select all of the text boxes and get rid of them.

Best Regards,

Andrew
Andrew Ritzmann

Ben

Re: Multiple frames animation with solutiontime

Postby Ben » Wed Mar 05, 2008 1:25 pm

Xico wrote:
But when I try to export my animations of these synchronized frames with the dialog box of the interface, it only exports an animation of the first frame.

This should work as you expected. Are you sure you set the export region to "All Frames" when you created the animation?

Ben

Re: Multiple frames animation with solutiontime

Postby Ben » Wed Mar 05, 2008 1:28 pm

Xico wrote:$!ATTACHTEXT
ANCHORPOS
{
X = 10
Y = 95
}
TEXT = "Timestep = |CURTIME| s "

It is simpler to use dynamic text for this:

Code: Select all

$!ATTACHTEXT
ANCHORPOS
{
X = 10
Y = 95
}
TEXT = "Timestep = &(SolutionTime) s"

Tecplot will keep the text updated automatically as the animation progresses; no need to delete and re-attach the text.

Xico
Experienced user
Posts: 12
Joined: Fri Feb 01, 2008 2:31 am
Location: Paris

Re: Multiple frames animation with solutiontime

Postby Xico » Mon Mar 10, 2008 1:30 am

Ben wrote:
Xico wrote:
But when I try to export my animations of these synchronized frames with the dialog box of the interface, it only exports an animation of the first frame.

This should work as you expected. Are you sure you set the export region to "All Frames" when you created the animation?

--> it works so well...

Ben wrote:"Timestep = &(SolutionTime) s"

--> it's so easy and so nice...

... sometimes I do complicated things for nothing :roll: ... Just open my eyes on the good option/button will be enough instead of writing lines and lines of macros and trying to find the good argument in the Reference Manual...
Thanks for all TecStaff!


Return to “Animation”

Who is online

Users browsing this forum: Google [Bot] and 8 guests