Quote Originally Posted by noeska
The changes for TBaseModel are in the svn now. It did not even have an custom create.

E.g. now you can do:
[pascal]
Model1 := TBaseModel.Create(nil);
Model1.LoadFromFile('models\tulip.3ds');
Model1.SaveToFile('tulip.txt');
Model1.Free;
[/pascal]

If you need advice on how to write your own descendant from TBaseModel let me know.
Hi 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