Hi,

I'm trying to implement a feature in the realXtend Viewer, which is based on the SL client code and I'm stuck. Maybe someone of you can help me understand, where the problem is.
I've added a new entry in the menu. If I click it, a new cube appears and after that I want to make some changes and edit parameters automatically. In the source code, I have used the Tool Placer:

        LLToolPlacer lltp;
        lltp.placeObject(x, y, mask);

That works well and I get a cube in the viewer, which is already selected. To do changes on the cube I need it as a volume object (LLVOVolume), because then, I can call already preexistend methods. I get the volume object via the viewer object. But if I try to get the selected object, it tells me the count is zero. The complete code would be:

        LLToolPlacer lltp;
        lltp.placeObject(x, y, mask);
        LLViewerObject *vo = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
        if(vo)
        {
            llinfos << "########## vo works! " << vo << llendl;
            LLVOVolume *volobjp = (LLVOVolume *)vo;
            if(volobjp)
            {
                llinfos << "########## volobjp works! " << volobjp << llendl;
                // some more code here
            }
            else llinfos << "########## volobjp is null " << volobjp << llendl;
        }
        else llinfos << "########## vo is null "<< vo << llendl;

This line tells me, that there are no selected objects:

        llinfos << "object count: " << LLSelectMgr::getInstance()->getSelection()->getObjectCount() << llendl;

Does anybody have an idea, where the problem is. Or is there another way to get the volume object I created some lines before?

Thanks for any help
best regards
Thomas

_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/SLDev
Please read the policies before posting to keep unmoderated posting privileges

Reply via email to