I will ask my question using the demo Rendering > Lining
In that demo we have 6 single objects. Is it possible to “save” that set of 6 objects after they are created as a TGLfreeform object ?
He intention is to use the new freeform as the bacground in another code. If this is possible to do is there a demo showing how to do it ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes normaly just save to native format (.glsm) with savetofile it will we be enought. I can't test Lining demo under lazarus it has a bug with TGLLineNode and TCollection.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Clicling in the GLscene editor I saw now .... the button Save all Scene ( as gls) I did this and saved. The doubt now is how to bring this saved file to use in another code
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerome. Sorry but it is not clear enough for me. Suppose for example that I have a code with a TGLscene component in which the is a single cube (design time) . When I run the code anther runtime cube will be cretaed .They are static. So after running I will see in the screen two cubes.
My qyestion is: which lines of code I should put in the FormClose event a code to save the scene I see (two cubes) in a file of the type gls or glsm or any other MESH format . The intention is to use / import / load this file in another code into a a freeform component to be used as background of another scene.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Correcting the speling and including more information
It is not clear enough for me. I need to “save the whole scene” in runtime . Suppose for example that I have a code with a TGLscene component in which there is a single cube (design time) . When I run the code I create in runtime another cube .They are static. So after running the code I will see in the screen two cubes. My question is: which lines of code I should put in the FormClose event to save the scene (two cubes) in a glsm format (or another mesh format) . My intention is to import this file in another code into a freeform component to be used as background of another scene.
Another doubt: I opened a GLscene code (design time) and clicked the TGLscene component twice. After this I clicked the button “Save Whole Scene”. Then I ran the demo GLSviewer and tried to open the saved file but I got the error “Read error TGL binary Reader read type error. Know why ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will ask my question using the demo Rendering > Lining
In that demo we have 6 single objects. Is it possible to “save” that set of 6 objects after they are created as a TGLfreeform object ?
He intention is to use the new freeform as the bacground in another code. If this is possible to do is there a demo showing how to do it ?
Yes normaly just save to native format (.glsm) with savetofile it will we be enought. I can't test Lining demo under lazarus it has a bug with TGLLineNode and TCollection.
Thanks Jerome. Good news but as I never did that please tell me ... What should I save as glsm ?
Clicling in the GLscene editor I saw now .... the button Save all Scene ( as gls) I did this and saved. The doubt now is how to bring this saved file to use in another code
Simply just use TGLFreeForm.SaveToFile in the code for saving mesh into a glsm file.
Hi Sergio,
Hi Jerome. Sorry but it is not clear enough for me. Suppose for example that I have a code with a TGLscene component in which the is a single cube (design time) . When I run the code anther runtime cube will be cretaed .They are static. So after running I will see in the screen two cubes.
My qyestion is: which lines of code I should put in the FormClose event a code to save the scene I see (two cubes) in a file of the type gls or glsm or any other MESH format . The intention is to use / import / load this file in another code into a a freeform component to be used as background of another scene.
Correcting the speling and including more information
It is not clear enough for me. I need to “save the whole scene” in runtime . Suppose for example that I have a code with a TGLscene component in which there is a single cube (design time) . When I run the code I create in runtime another cube .They are static. So after running the code I will see in the screen two cubes. My question is: which lines of code I should put in the FormClose event to save the scene (two cubes) in a glsm format (or another mesh format) . My intention is to import this file in another code into a freeform component to be used as background of another scene.
Another doubt: I opened a GLscene code (design time) and clicked the TGLscene component twice. After this I clicked the button “Save Whole Scene”. Then I ran the demo GLSviewer and tried to open the saved file but I got the error “Read error TGL binary Reader read type error. Know why ?
Hi Sergio for saving scene you can do directly with TGLScene.SvaeToFile but Freeform's datas (vertices, uv..) are not saved.
2nd Solution convert all object to freefrom (see meshes/FeedBack demo)put in a TGLFreeForm as submesh then savetofile (glsm format)
3nd Solution you can use TGLVFSPak or TGLArchiveManager tou put all needed file in a sort of ZIP
I'll try to make a little sample this week end
Thank you very mucjh Jerome. I will study the three solutions. A little sample would be very useful