Public Member Functions | |
| HRESULT | SaveObject ([in] VARIANT szFileName,[in] VARIANT szObjName) |
| HRESULT | SaveObjectEx ([in] VARIANT szFileName,[in] VARIANT szAuthor,[in] VARIANT szDescr,[in] VARIANT vThumbnail,[in] VARIANT szObjName) |
| HRESULT | LoadObject ([in] BSTR bszFileName,[in] BSTR bszOwnerName,[out, retval] BSTR *pVal) |
| HRESULT | LoadPreobject ([in] BSTR bszFileName,[in] BSTR bszOwnerName,[out, retval] BSTR *pVal) |
| HRESULT | CreateRsFileHandle ([in] BSTR bszFileName,[in] RtDWORD dwFlags,[out, retval] VARIANT *pvRsFileHandle) |
| HRESULT | SaveSystem ([in] VARIANT szFileName,[in] VARIANT szAuthor,[in] VARIANT szDescr,[in] VARIANT vThumbnail) |
| HRESULT | SaveHistory ([in] VARIANT szFileName,[in] VARIANT szAuthor,[in] VARIANT szDescr,[in] VARIANT vThumbnail) |
| HRESULT | LoadHistory ([in] VARIANT szFileName) |
| HRESULT | GenericLoad ([in] VARIANT szFileName,[in] VARIANT szTargetName,[in] VARIANT dwFlags,[out, retval] VARIANT *pvObject) |
Properties | |
| VARIANT * | LoadSystem ([in] VARIANT szFileName) [get] |
| HRESULT IRiFileIOItem::SaveObject | ( | [in] VARIANT | szFileName, | |
| [in] VARIANT | szObjName | |||
| ) |
Save object to file. The whole subgraph will be saved if the object contains sub-objects.
| szFileName | [in] Name of the file. | |
| szObjName | [in] Identification of the object in the graph, its full name, empty string indicates the selected object. |
//save object MyCube from Space 3D to the file myObject.RsObj RsFileIO.SaveObject('c:\\myObject.RsObj', 'Project/Space 3D/MyCube') //save the selected object to the file mySelectdObject.RsObj RsFileIO.SaveObject('c:\\mySelectedObject.RsObj', '')
| HRESULT IRiFileIOItem::SaveObjectEx | ( | [in] VARIANT | szFileName, | |
| [in] VARIANT | szAuthor, | |||
| [in] VARIANT | szDescr, | |||
| [in] VARIANT | vThumbnail, | |||
| [in] VARIANT | szObjName | |||
| ) |
Save object to the file. The whole subgraph will be saved if the object contains sub-objects.
| szFileName | [in] Name of the file. | |
| szAuthor | [in] Author of the file. | |
| szDescr | [in] File description. | |
| vThumbnail | [in] IRdBitmap object as file thumbnail. | |
| szObjName | [in] Identification of the object in the graph, its full name, empty string indicates the selected object. |
//save object MyCube from Space 3D to the file myObject.RsObj. Thumbnail = System.CreateDO("Common Data Package/Bitmap Data"); Thumbnail.LoadFromFile('c:\\myObjThumbnail'); RsFileIO.SaveObject('c:\\myObject.RsObj', 'Mike', 'this is the first draft', Thumbnail, 'Project/Space 3D/MyCube') //save the selected object to the file mySelectdObject.RsObj without thumbnail. RsFileIO.SaveObject('c:\\mySelectedObject.RsObj', 'Mike', 'Currently selected object', 0, '')
| HRESULT IRiFileIOItem::LoadObject | ( | [in] BSTR | bszFileName, | |
| [in] BSTR | bszOwnerName, | |||
| [out, retval] BSTR * | pVal | |||
| ) |
Load object from the file and add it to graph, including its subgraph.
| bszFileName | [in] Name of the file. | |
| bszOwnerName | [in] Identification of the object in the graph, where loaded objects will be added. |
// load object from the file 'myObject.RsObj' and add it to the current scene. RsFileIO.LoadObject('c:\\myObject.RsObj', Space.CurrentScene()) // load object from the file 'mySelectedObject.RsObj', // add it to space 3D object and store name of loaded object in szLoadedObj variable. szLoadedObj = RsFileIO.LoadObject('c:\\mySelectedObject.RsObj', 'Project/Space 3D/')
| HRESULT IRiFileIOItem::LoadPreobject | ( | [in] BSTR | bszFileName, | |
| [in] BSTR | bszOwnerName, | |||
| [out, retval] BSTR * | pVal | |||
| ) |
Load object from file and add it to graph including its subgraph.
The file is located in pre-objects directory which is:
| bszFileName | [in] Name of the file. | |
| bszOwnerName | [in] Identification of the object in the graph, where loaded objects will be added. |
// load object from file 'myPreObject.RsObj' located in pre-objects directory and add it to the current scene RsFileIO.LoadObject('myPreObject.RsObj' , Space.CurrentScene())
| HRESULT IRiFileIOItem::CreateRsFileHandle | ( | [in] BSTR | bszFileName, | |
| [in] RtDWORD | dwFlags, | |||
| [out, retval] VARIANT * | pvRsFileHandle | |||
| ) |
Method creates File Handle object for specified Rosetta file and opens the file.
You can use the handle for:
To control the close action call Close method before you release the handle.
| bszFileName | [in] filename for which the handle will be created. | |
| dwFlags | [in] IRsFileHandle::ReFileHandleOpenFlags Possible values:
|
Standard HRESULT processing can be applied to the result.
hFile = RsFileIO.CreateRsFileHandle('c:\\myObject.RsObj', 1); // Open file for reading. indThumbnail = hFile.FindChunk('RdChunk Thumbnail', -1); // Find thumbnail chunk. if (indThumbnail != -1) { objThumnail = hFile.GetChunk(indThumbnail, 0); // If it is found, get it. objRdBitmap = objThumnail.GetAsRdBitmap(); // Get the thumbnail as RdBitmap object. [...] }
| HRESULT IRiFileIOItem::SaveSystem | ( | [in] VARIANT | szFileName, | |
| [in] VARIANT | szAuthor, | |||
| [in] VARIANT | szDescr, | |||
| [in] VARIANT | vThumbnail | |||
| ) |
Save system content to .ctx file.
| szFileName | [in] .ctx file name for save. | |
| szAuthor | [in] Author of the file. | |
| szDescr | [in] File description. | |
| vThumbnail | [in] IRdBitmap object as file thumbnail. |
var mainDir = System.GetMainDir();
var fileName = "myCTX.ctx";
var author = "My name here";
var desc = "my file description";
var thumb = System.CreateDO('Common Data Package/Bitmap Data');
thumb.LoadFromFile(mainDir + '\\textures\\COLOR6.BMP');
RsFileIO.SaveSystem(fileName, author, desc, thumb);
| HRESULT IRiFileIOItem::SaveHistory | ( | [in] VARIANT | szFileName, | |
| [in] VARIANT | szAuthor, | |||
| [in] VARIANT | szDescr, | |||
| [in] VARIANT | vThumbnail | |||
| ) |
Save command history to .RsHst file.
| szFileName | [in] .RsHst file name for save | |
| szAuthor | [in] Author of the file. | |
| szDescr | [in] File description. | |
| vThumbnail | [in] IRdBitmap object as file thumbnail. |
var mainDir = System.GetMainDir();
var fileName = "myHist.RsHst";
var author = "My name here";
var desc = "my file description";
var thumb = System.CreateDO('Common Data Package/Bitmap Data');
thumb.LoadFromFile(mainDir + '\\textures\\COLOR6.BMP');
RsFileIO.SaveHistory(fileName, author, desc, thumb);
| HRESULT IRiFileIOItem::LoadHistory | ( | [in] VARIANT | szFileName | ) |
Loads command history from .RsHst file.
| szFileName | [in] .RsHst file name for load. |
var mainDir = System.GetMainDir();
var fileName = "myHist.RsHst";
var combo = mainDir + '\\' + fileName;
RsFileIO.LoadHistory(combo);
| HRESULT IRiFileIOItem::GenericLoad | ( | [in] VARIANT | szFileName, | |
| [in] VARIANT | szTargetName, | |||
| [in] VARIANT | dwFlags, | |||
| [out, retval] VARIANT * | pvObject | |||
| ) |
Function loads any known Rosetta file type object.
The file type is detected not only from the file extension, but from the contents too.
| szFileName | [in] Full path of the file you want to load | |
| szTargetName | [in] Target object. In case you are loading material, you can specify here object on which it should be applied. | |
| dwFlags | [in] Load flags (type of IRsPackageFileIOReg::RePckFileIOGenLoadFlags)
|
VARIANT* IRiFileIOItem::LoadSystem([in] VARIANT szFileName) [get] |
Loads system content file (stored e.g. during latest system shutdown).
| szFileName | [in] .ctx file name to load. |
var mainDir = System.GetMainDir();
var fileName = "myCTX.ctx";
var combo = mainDir + '\\' + fileName;
RsFileIO.LoadSystem(combo);
1.5.5