Solved SceneSaverData document

Hello,

I was having a strange problem having different resutls when exporting a scene using a custom SceneSaverData.

If we export from the main menu File, Export..., it works fine, and I can see it calls SceneSaverData::Save() with the active document.

If we export from the Objects Manager File, Export Selected Object As..., it will fail in some of my objects when trying to retrieve a BaseLink, and I can see it's using another (cloned?) document. I fixed it by trying with ForceGetLink() if the link is null.

Is that difference in the documents passes to the exporter by design?
Shouldn't my BaseLinks just work?

Thanks,
Roger

Hi @rsodre this is expected since the document is cloned first (via IsolateObjects). You can notice the same behavior if you call IsolateObjects with a Mograph Cloner but don't pass the effector, obviously the link will be lost.

Note that you may have properly selected both, and in this case, if this still fails, you have to be sure to properly implement CopyTo to also forward the BaseLink to the new copy or to expose the BaseLink in the object's BaseContainer so Cinema4D will be able to update it properly.

Hope this help,
Cheers,
Maxime.

@m_adam said in SceneSaverData document:

you have to be sure to properly implement CopyTo to also forward the BaseLink to the new copy or to expose the BaseLink in the object's BaseContainer so Cinema4D will be able to update it properly.

If my object have BaseLinks defined in the resource file, shouldn't C4D take care of passing it to the cloned document?

Are you speaking about a LINK? Normally it should handle it without issue.

Hi,

without further feedback, we will consider this thread as solved by tomorrow and flag it accordingly.

Cheers,
Ferdinand

MAXON SDK Specialist
developers.maxon.net