Regular API function


Description Adds or removes custom data to be saved together with a scene. This function is useful for external applications or plugins which want to save their data together with a scene. Use in conjunction with simGetSceneCustomData and simGetSceneCustomDataLength. See also simAddObjectCustomData, simWriteCustomDataBlock and simPersistentDataWrite.
C synopsis simInt simAddSceneCustomData(simInt header,const simChar* data,simInt dataLength)
C parameters
header: identifier for the custom data. If you plan to add custom data (as a company or individual), always use the same header (because only you will know what data type is stored under that header) and stick to it. The best is to use the serial number of your V-REP copy (check the "Help" menu, in the "About" item for the serial number). Otherwise, you risk collision with other developer's data which might use the same header as yours.
data: your custom data. If NULL, the current data under that header will be removed. If you have several items or data types to save, it is your responsibility to pack and code it in data (don't use various headers for each of your items that you want to save with a scene (risk of collision with other developers data (see above))!)
dataLength: the length of your custom data

The data will be copied to an internal buffer, and next time a scene is saved, will also be saved. The data buffer can be released after this call.
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=simAddSceneCustomData(number header,string data)
Lua parameters
Same as C-function. (remember that a string in Lua might contain any character, also embedded zeros)
Lua return values
Same as C-Function.

All regular API functions on one page