Hello Michael, On 05/23/2011 07:42 AM, Michael Raab wrote: > osg::MyAttachmentPtr proto = osg::MyAttachmentPtr::dcast( > osg::MyAttachment::getClassType().getPrototype()); > if( proto != osg::NullFC ) > { > beginEditCP(proto, osg::Attachment::InternalFieldMask); > proto->setInternal(true); > endEditCP(proto, osg::Attachment::InternalFieldMask); > } > > But setting that internal flag seems to not to avoid to save that attachment > to OSB.
argh, it seems the 1.x OSB writer ignores that setting, sorry about that. I'm not sure it is flexible enough for this case, but you could try registering your handler class for loading MyAttachment from OSB. You can use OSGNFIOGenericAtt.{h,cpp} as a starting point and have almost empty read/writeFC functions: FieldContainerPtr NFIOMyAttachment::readFC( const std::string &/*typeName*/) { skipFCFields(); return NullFC; } void NFIOMyAttachment::writeFC(const FieldContainerPtr &/*fc*/) { writeEndMarker(); } I'm just not sure if the loader can deal with the NullFC returned from readFC and what exactly will happen with fields in other containers that contain pointer to the attachment. Cheers, Carsten ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users