Page 1 of 1

is ImageLayer:SetSourceImage() implemented???

Posted: Fri Apr 01, 2005 12:51 pm
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

Posted: Fri Apr 01, 2005 2:06 pm
by anigreator
Would be good to get the documentation to actually reflect what is implemented, as with shape.fName.

Posted: Fri Apr 01, 2005 2:57 pm
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.

Posted: Fri Apr 01, 2005 3:43 pm
by janimatic
wowwww
ty 7feet you were right!