Вы находитесь на странице: 1из 3

TIG (c) 2010

All Rights Reserved.


THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
[NB:definition and transformation methods are Copyright 2008, AlexM]
###########################################################################
ImageAnimator.rb
###########################################################################
Needs 'image_class.rb' [comes in the same folder]
###########################################################################
Adds new Tool 'ImageAnimator':
Under Menu > View > ImageAnimator... [submenu]
OR
View Toolbars > ImageAnimator
The Tools include the following:
"Set Folder for Selected Image"
This sets the 'folder' of sequential 'image-files' that will be used by the
Image when its animation is run. The 'folder' chosen should contain images
with sequential name/numbering as they will load in that order - e.g. as
they are exported from a GIF or movie file - image001.png, image002.png etc
They should also all be the same size and filetype[recommended]. PNG files
can offer transparency so are prefered for 'cutouts' of people etc. Any
set 'folder' are remembered across sessions with the SKP. If an Image has
a 'folder' set that no longer exists then it is auto-reset to 'nil' and it
will need redefining.
"Set Folder from Selected Image to 'Nil'"
This sets the selected Image(s) 'folder' to 'nil' thereby effectively
removing its animation abilities. Should an Image has a 'folder' set that
no longer exists then it is auto-reset to 'nil' and it will need redefining.
"Set Timer for Selected Images"
This sets the timer [in seconds] for the selected Image(s). It defaults to
0.0 - this value means that the Image only animates as the active Scene tab
changes. Any value > 0.0 sets the frame-rate in seconds - 0.1 to 0.2 are
often suitable values - when the Images are animated their animation
effects continue as you work/pan/zoom or make screen-captures etc.
The shortest workable 'timer' is 0.01 seconds. Having several animations
running simultaneously will slow down all animations frame-changes so if
this situation is expected then reduce the frame rate of all animated
Images approrpiately.
"Set FaceMe for Selected Images"
This sets the selected Image(s) 'faceme' behavior. The choices are:
'None' - the Image does not face the camera [default]
'Bottom-Left' - the Image is placed into a special Group - 'FaceMeImage' which faces the camera, pivoting around the Z_AXIS anchored at its
bottom-left corner.
'Bottom-Center' - the Image is placed into a special Group - 'FaceMeImage' which faces the camera, pivoting around the Z_AXIS anchored at its
bottom-center point.
'Bottom-Right' - the Image is placed into a special Group - 'FaceMeImage' which faces the camera, pivoting around the Z_AXIS anchored at its
bottom-right corner.
A 'FaceMeImage' Group is treated as if it were an Image by the
ImageAnimator tools. If later on you reset its 'faceme' behavior to 'None'
then the Group is exploded and the Image reverts to a plain Image.

"Animate Selected Images"


This starts the animation effects on the selected Image(s), using the
'folder' and 'timer' that each one has set as attributes. Depending on its
'timer' each Image will animate as the Scene tab changes or continuously as
you work doing other things. The first frame in each Image's animation is
the first image-file in its 'folder'.
"Stop Selected Images Animation"
This stops the animation effects on the currently selected Image(s).
Each 'stopped' Image uses its currently loaded image-file.
"Animate All Images"
This starts the animation effects on ALL suitable Image(s) - i.e those with
a 'folder' set; using the 'timer' that each one has set as an attribute.
Depending on its 'timer' each Image will animate as the Scene tab changes
or continuously as you work doing other things. The first frame in each
Image's animation is the first image-file in its 'folder'.
"Stop All Image Animation"
This stops the animation effects on ALL Image(s).
Each 'stopped' Image uses its currently loaded image-file.
Menu only items:-------------"Make_Unique"
This processes the Selected Image(s) with 'make_unique', i.e. if there is
more that one Instance of an Image in the Model then the Selected Image is
given another Definition 0 it is a lone Instance so only it 'animates'.
"Clone"
If you manually 'Copy' an Image it becomes another Instance of the same
Image Definition and the Instances will 'animate' together. You could use
'Make_Unique' on the Copy to prevent this, alternatively use this 'Clone'
function - it makes an exact 'copy' of the Selected Image over the original.
However, it is a 'clone' and is 'unique' having a separate Definition, so it
will 'animate' as a lone Image.
###########################################################################
Donations:
By Paypal.com to info @ revitrev.org
###########################################################################
Version:
1.0 20101210 First issue.
1.1 20101212 New Menu items added - Make_Unique and Clone

Updates:
20101212 loader now more robust.
20101213 new methods added. skm, material and ImageAnimator.
20101213a new gifxtractor tool added.
The attached zip file should be extracted into the Plugins folder - there should
be a SKMtools_loader.rb file that goes directly into Plugins, the there is also
a SKMtools folder containing several files and sub-folders - theses should all
remain in their relative sub-folders, and the SKMtools folder itself goes into P
lugins.
The wide-ranging set of tools and code that these files provide briefly is as fo

llows:'skm_class.rb' - a new class 'SKM' added to the API - with SKM-file methods - .i
mport, .export, .save_texture and .save_thumbnail, PLUS .extract and .save_textu
re_and_thumbnail - a separate post outlines these in detail...
'material_class.rb' - extensions of the 'Sketchup::Material' class - with new Ma
terial methods - .save_texture, .save_thumbnail, .save_bumpmap, .export_skm, .de
lete and .name=, PLUS .save_texture_and_thumbnail- a separate post outlines thes
e in detail...
There is a file 'podium_texture+bumpmap.rb' that makes a new method podiumtextur
ebumpmap(materialname, folder, boolean) to export a given material by name into
a given folder as a bumpmap PNG [the optional boolean determines if the bumpmap
is 'inverted' or not] using specific naming conventions etc - it could easily be
modified to suit other applications - a separate post outlines this in detail..
.
'image_class.rb' - extensions of the 'Sketchup::Image' class - with new Image me
thods - .definition, .transformation, .transformation=, .use_as_material, .make_
unique, .copy, .clone, .imagefile, .imagefile=, .save_imagefile and a series of
methods relating to Image-Animation - .folder, .folder=, .timer, .timer=, .facem
e, .faceme=, .start_animation, .start_animation_all, .stop_animation and .stop_a
nimation_all - a separate post outlines these in detail...
There are various cross-platform Java .jar executable applets in the folder requ
ired for some of the image and SKM file manipulations. There is also a 'SKMDefau
ltXMLs' folder containing the premade XML files required for new SKM files.
There is a script 'ImageAnimator.rb' that adds a new Tool to the Plugins Menu /
Toolbar. This allows you to set a selected Image's 'folder' containing sequentia
l image-files for use in an Image-Animation. It also allows you to set the selec
ted Image(s) 'folder' to 'Nil'. You can also set the selected Image(s) 'timer' t
o a frame-rate in seconds [the default of 0.0 means the Image only updates as a
Scene tab changes]. You can also set the selected Image{s] 'faceme' behavior bet
ween 'None' and facing the camera pivoting about Bottom-Left, Bottom-Center and
Bottom-Right locations of the image: when 'faceme' is set the Image is grouped w
hen 'None' it is not. The other controls are 'Animate Selected Images' and 'Stop
Selected Images' Animation' or 'Animate All Images' and 'Stop All Image Animati
on' = PLUS new menu items 'make_unique' and 'clone'.
An animated image will change as you work/pan-zoom or take a screen shot. It sho
uld also change with the Scene-tabs if timer=0.0..

Вам также может понравиться