Hi noeska,Originally Posted by noeska
I'm attempting to use your model load as a bridge between my format and the popular ones (.3ds, etc.)...
Anyhow when I try to use the LoadFromFile() method of the TBaseModel class, my program crashes because the variable FileFormats is Nil at that point
[pascal]procedure TBaseModel.LoadFromFile(AFilename: string);
var
Ext: string;
GraphicClass: TBaseModelClass;
begin
Ext := ExtractFileExt(AFilename);
Delete(Ext, 1, 1);
GraphicClass := FileFormats.FindExt(Ext); <----BLOWS UP HERE, FileFormats is Nil!!!
LoadFromFile(GraphicClass, AFilename);
//Check if model is loaded
Calculatesize; //calculate min and max size
CalculateRenderOrder; //set transparency order...
//Needs to be called here and not before or else...
InitSkin;
end;
[/pascal]
My code is basically this:
[pascal]
Uses
Model;
Var
Model : TBaseModel;
Begin
Model := TBaseModel.Create(Nil);
Try
Model.LoadFromFile(<some filename>);
....
Finally
Model.Free;
End;
End;[/pascal]
Any ideas?
cheers,
Paul
Bookmarks