Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/10/2007 at 22:12, xxxxxxxx wrote:
User Information: Cinema 4D Version: 10.111 Platform: Language(s) : C++ ;
--------- Hi,
I'm running into a strange problem. Hopefully somebody here knows what's wrong.
I'm trying to set some states of the layer browser. That's all fine, except when I'm trying to un-solo a layer. When I un-solo a layer, all the objects disappear from the Object Manager and viewports. They'll come back if I toggle any of the layer buttons.
Here's the code I'm using:
GeListHead* llist = bDoc->GetLayerObjectRoot(); GeListNode* layer = llist->GetFirst(); LayerObject* lObj = SearchLayers(layer, bDoc, layerName); //my own function to search for a specific layer const LayerData* pLData = lObj->GetLayerData(bDoc, TRUE); LayerData lData = *pLData; lData.solo = StringToBool(value); //value is coming from somewhere else lObj->SetLayerData(bDoc, lData);
//I'm trying all of these to update the the scene lObj->Message(MSG_UPDATE); EventAdd(EVENT_FORCEREDRAW); DrawViews(DA_FORCEFULLREDRAW, NULL); EventAdd();
Any ideas?
On 27/10/2007 at 16:44, xxxxxxxx wrote:
Please, any help at all?
The layer button states change, so it looks like the right info is being sent to the layer object. Looks like some kind of core message is not being sent correctly.
I tried adding bDoc->SetChanged(); but that didn't help, either.
On 30/10/2007 at 03:37, xxxxxxxx wrote:
I can confirm this. No idea why this happens. I asked the developers for help.
cheers, Matthias
On 30/10/2007 at 08:16, xxxxxxxx wrote:
Thank you for the help, Matthias. I'm looking forward to hearing back from the developers. Hopefully, there's a workaround or an easy solution.
On 02/11/2007 at 03:04, xxxxxxxx wrote:
Additionally to changing the LayerData you also have to delete the document's Solo bit. Please check the attached source code. It un-solos the first layer.
> _ > Bool MenuTest::Execute(BaseDocument *doc) > { > GeListHead *list = NULL; > list = doc->GetLayerObjectRoot(); > if(!list) return FALSE; > > LayerObject *layer = NULL; > layer = (LayerObject* )list->GetFirst(); > if(!layer) return TRUE; > > const LayerData *data = layer->GetLayerData(doc,TRUE); > LayerData newdata(*data); > newdata.solo = FALSE; > > doc->StartUndo(); > > doc->AddUndo(UNDO_CHANGE,layer); > layer->SetLayerData(doc, newdata); > > //delete the Solo bit > doc->AddUndo(UNDO_BITS,doc); > doc->ChangeNBit(NBIT_SOLO_LAYER, NBIT_DEL); > > doc->EndUndo(); > > EventAdd(); > > return TRUE; > } > _
On 04/11/2007 at 12:32, xxxxxxxx wrote:
Excellent! Thank you! If possible, I think it would be a good idea to make a note of that on the layer data page for the next SDK release.