problem with displaying images from scripts

Asked by Andy Dolph

I'm on Mac OSX 10.6
running the latest BZR though the problem also occurs in the current release.

When I do the following at the beginning of a script:
image action load name plea filename images/Pleiades_large.png coordinate_system viewport scale 1
image name plea alpha 1 duration 3

it appears that basically nothing happens

The display dims a tiny bit, but otherwise nothing changes.

the Pleiades_large.png file does exist and is in the images subdirectory of the scripts directory where the script is.

it is a 2048x2048 square .png

in trying to figure this out, I tried larger numbers then one for the alpha value and it appears to be working on a percent scale where 100% is fully opaque. when I use 100 for the alpha value it displays just fine, but it "pops" in - no fade, no mater what I set the duration too - I've tried 3 sec - 300 sec.

Any idea what's happening?

Thanks!!

Andy

Question information

Language:
English Edit question
Status:
Solved
For:
Nightshade Legacy Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Dolph
Solved:
Last query:
Last reply:
Revision history for this message
Andy Dolph (acdolph) said :
#1

oh - one other thing - strangely enough - if I copy the lines

image action load name black filename demo/black.png coordinate_system viewport alpha 0 scale 2
image name black alpha 1 duration 1

from the demo.sts downloaded from your site, they don't work either, even though the demo itself runs properly.

I'm trying to imagine how this could be the case....

I'm editing the files in textwrangler on the mac, and I'm wondering if somehow the text editor is saving the files in a problematic way.....

I'm using textwrangler's default saving options of
Line breaks: Unix (LF)
Encoding: Unicode (UTF-8, no BOM)

Other options for line breaks are: Windows (CRLF) or Classic Mac (CR)
Other options for encoding are many: UTF-8, UTF-16, UTF-16 no BOM, UTF-16 Little-Endian, UTF-16 Little-Endian no BOM

is there a reason one of these would work more correctly? if so, which one?

The only difference I can think of between the demo.sts file and mine is that I wrote mine on my mac in Textwrangler, and whoever developed the demo probably didn't.

Thanks!!

Andy

Revision history for this message
Rob Spearman (rob-digitaliseducation) said :
#2

Be sure to read the Creating Scripts for Nightshade document:

http://nightshadesoftware.org/downloads/nightshade-scripting-howto.pdf

Your trouble is likely that your script ends too soon (before you can see anything).

Rob

Revision history for this message
Lionel RUIZ (astro2kpremium) said :
#3

Hello Andy,

Strange, it should work.

Or do you forget to put a

wait duration 4
script action pause

To view the result before it quits the script ?

LF is fine for Unix but maybe all cases should work... as CRLF is fine also.

the alpha value range is 0.0 to 1.0, other value must be avoided as it won't do what you want.

Best regards,

Lionel RUIZ

Revision history for this message
Andy Dolph (acdolph) said :
#4

As usual - GIGO - I get it now - I didn't understand that the "wait" was required before the pause - I assumed that they would do the same thing, and they don't...

so it's working, mostly - but when I set alpha to 1.0 (or 1) it fades in to maybe 95% opacity, not 100% so when I'm reseting things behind it, you can see a ghost of the movement. which I'd really like to avoid.

Thanks for your help!

Revision history for this message
Lionel RUIZ (astro2kpremium) said :
#5

I assume that the transparency of your front element wasn't made properly as it should work.

Did you gave enough time to make the fade in ?

I recommend putting at least 1 second more in the "wait duration" command.

And also, don't just do the fade in/out just after having loaded the elements.

let it be loaded with a wait duration before activating them.

And notice also that during a crossfade, you can't have one hiding the other.

Revision history for this message
Andy Dolph (acdolph) said :
#6

Thanks Lionel,

a 1 second wait after the load solved it.

Andy