Thanks to all. Finally I found my problem, I had some corruption in
the datas that I was using, but the code was correct.

Thanks again

Regards from Canary Islands

On Thu, Apr 29, 2010 at 19:18, Todd J. Furlong <[email protected]> wrote:
> That looks similar to code we use to do the same thing.  Only difference is
> we check rr.validNode instead of rr.success, but you say it is successful.
>  We are using OSG 2.8.2.
>
> -Todd
>
> On 4/29/2010 10:27 AM, Manolo Padron Martinez wrote:
>>
>> Hi:
>>
>> We're trying to load an osg model from an stream. We got the code like
>> this
>>
>>        membuf sb((char *)Data, Size);
>>        std::istream stream(&sb);
>>        osgDB::ReaderWriter* reader =
>> osgDB::Registry::instance()->getReaderWriterForExtension("osg");
>>        if(reader)
>>        {
>>                osgDB::ReaderWriter::ReadResult rr =
>> reader->readNode(stream,0);
>>                if(rr.success())
>>                {
>>                        osg::Node *new_model = new
>> osg::Node(*rr.getNode());
>>                        return new_model;
>>                }
>>        }
>>
>>        return NULL;
>>
>>  Its seems to load as it should. Rr is successfull but when I try to
>> add the node to a treenode I didn't saw it on screen. If I change the
>> code before for the code to load it from disk It works perfectly. Any
>> idea? There are a problem with the plugin of osg file when a stream is
>> used to read the node?
>>
>> Regards from Canary Islands
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to