内容表

关于

NodeData based classic plugin classes can implement NodeData::Read() and NodeData::Write() . This allows to store internal data that is not stored in the BaseContainer when the scene is saved to a *.c4d file.

注意
NodeData::Read() and NodeData::Write() are implemented typically also NodeData::CopyTo() should be implemented.

NodeData::Read() corresponds to C4DAtom::Read() , NodeData::Write() corresponds to C4DAtom::Write() .

另请参阅 BaseDocument Disc I/O .

用法

NodeData::Read() is called when a *.c4d file is loaded, NodeData::Write() is called when the element is saved to a *.c4d file. The given HyperFile object represents this *.c4d file.

// This example stores an internal list and an integer value with the actual object.
Bool Read( GeListNode * node, HyperFile * hf, Int32 level) { if (level >= 0) // checks the plugin level { // read a GeListHead _branchHead->ReadObject(hf, true ); // read an integer value hf-> ReadInt32 (&_value); } return true ; } Bool Write( GeListNode * node, HyperFile * hf) { // store a GeListHead _branchHead->WriteObject(hf); // store an integer value hf-> WriteInt32 (_value); return true ; }

The arguments of the functions are:

注意
The order of operations needs to be the same in both function implementations.
NodeData::Read() is called the element is not yet part of a BaseDocument .
To check if a message dialog can be shown in the context of NodeData::Read() , use HyperFile::GetFilterFlags() to check if SCENEFILTER::DIALOGSALLOWED is set.

延伸阅读

HyperFile::WriteInt32
Bool WriteInt32(Int32 v)
GeListNode
Represents a C4DAtom that resides in a 4D list.
定义: c4d_baselist.h:1767
HyperFile::ReadInt32
Bool ReadInt32(Int32 *v)
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
HyperFile
定义: c4d_file.h:1069
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1