is ImageLayer:SetSourceImage() implemented???

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

is ImageLayer:SetSourceImage() implemented???

Post by janimatic »

Hey LM!

is ImageLayer really implemented?
i get an error when i do this :


JS_image_sequence.bitmapPath = LM.GUI.OpenFile("Select the first image file of the sequence")
if (self.bitmapPath == "") then
return
end
JS_image_sequence.iLayer = moho:CreateNewLayer(MOHO.LT_IMAGE)
-- ERROR HERE :
self.iLayer:SetSourceImage(self.bitmapPath)

I checked the file path issues using io.read and seem fine...
The error is :
"attempt to call method SetSourceImage (a nil value)"
so i guess it is not in the API (as stated in the doc)??

Or am i doing something wrong with the path? (any special issue under windows? i am using string.format() for escape characters)

thank you!!

Julien
anigreator
Posts: 36
Joined: Tue Mar 22, 2005 11:47 am

Post by anigreator »

Would be good to get the documentation to actually reflect what is implemented, as with shape.fName.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

This I just pulled out of the Explosion particle menu script:

Code: Select all

local group = moho:LayerAsGroup(moho:CreateNewLayer(MOHO.LT_GROUP))
So I guess the problem is one of those instances where a function might be looking at a layer in too generic a manner, so you have to kick it in the bum and let it know specifically the type of layer you're working with. So I guess the call would be

Code: Select all

JS_image_sequence.iLayer = moho:LayerAsImage(CreateNewLayer(MOHO.LT_IMAGE)) 
Yay! Image sequence importer! Once it's in working order, It would be great if you could make it kind of an overall sequence importer, the same code with minor changes should let you import sequences of Illustrator files, 3D OBJects. Cool.
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

wowwww
ty 7feet you were right!
Post Reply