Set List of Objects to show in Attribute Manager
-
On 11/10/2016 at 09:31, xxxxxxxx wrote:
It is a commandData plugin, and this is under my def Command section. It is supposed to trigger when a button is clicked in my UI.
They are not Objects in the BaseObject sense, they are Markers which are BaseList2D objects.
As I mentioned in my first post, I have other buttons in my UI that allow you to access a single marker in the Attribute Manager, but I have another button that I would like to not only select each one and put all the attributes in the Attribute Manager at once, but also select them in the timeline.
-
On 11/10/2016 at 09:35, xxxxxxxx wrote:
Ah, sorry, I overlooked the "(They would all be markers)". Yep, that may indeed work a little different. I'll look into it tomorrow.
-
On 11/10/2016 at 10:58, xxxxxxxx wrote:
This should make the question clearer.
The selection status for markers can be done with bits. But the attributes won't show up unless you physically click on one of them:import c4d def main() : marker = c4d.documents.GetFirstMarker(doc) #Select all of the makers while(marker) : marker.ChangeNBit(c4d.NBIT_TL1_SELECT, c4d.NBITCONTROL_SET) #marker.ChangeNBit(c4d.NBIT_TL1_SELECT, c4d.NBITCONTROL_CLEAR) marker = marker.GetNext() ###### At this point the AM pallet does not show the attributes for the selected markers ###### c4d.EventAdd(c4d.EVENT_FORCEREDRAW) #<-- does not work c4d.EventAdd() <---does not work #In many cases. The AM can be forced to show up like this #But in this case it does not work c4d.SendCoreMessage(c4d.COREMSG_CINEMA, c4d.BaseContainer(c4d.COREMSG_CINEMA_FORCE_AM_UPDATE)) #Bret tried to force it to refesh using something like this: did = c4d.DescID(c4d.TLMARKER_TIME) c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_TIMELINE, obj, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN, did) #None of these work. #The AM pallet for the markers refuses to show itself without physically clicking on one of them!! if __name__=='__main__': main()
-ScottA
-
On 12/10/2016 at 09:25, xxxxxxxx wrote:
Hi Bret,
as I said yesterday, I was on the completely wrong track in my first post. Sorry, for that.
Scott already pointed out the correct bit to use in order to select markers (note, that there are four of these for the four Timeline Managers that can be opened in parallel). And as Scott also found out, none of his ways works to have multiple selected markers shown in Attribute Manager. I played around with it today and I'm very sorry, but I also wasn't able to find a workaround.
What really is missing here in Python is ActiveObjectManager_SetObjects() (note the additional s in the end) from the C++ API. We have added it to our list of missing Python functions and will hopefully be able to provide it with one of the future updates.I know, we are in the Python sub-forum, but just for completeness in C++ it would work like so:
AutoAlloc<AtomArray> arr; BaseList2D* marker = GetFirstMarker(doc); if (!marker || !arr) return true; while (marker) { arr->Append(marker); marker = marker->GetNext(); } ActiveObjectManager_SetObjects(ACTIVEOBJECTMODE_TIMELINE, arr, 0); EventAdd();
-
On 12/10/2016 at 10:30, xxxxxxxx wrote:
Rats. That's unfortunate it's missing. Thanks for the help.
-
On 25/10/2017 at 00:16, xxxxxxxx wrote:
Any news on the addition of the ActiveObjectManager_SetObjects() function in python?
As a workaround.. Is there maybe an undocumented way to call c++ functions from python?
-
On 25/10/2017 at 01:32, xxxxxxxx wrote:
-
On 25/10/2017 at 01:50, xxxxxxxx wrote:
Hi,
unfortunately ActiveObjectManager_SetObjects() did not make it in R19 SP1. It's not forgotten and slowly moves to the top of our ToDo list.
@gr4ph0s: You may have overlooked the "s" or thought it's a typo, but there's indeed another function ActiveObjectManager_SetObjects() in the C++ SDK, which is currently not yet exposed to Python.
-
On 25/10/2017 at 01:51, xxxxxxxx wrote:
-- EDIT--
Andreas already answered while I was tying this post.. sorryNice to hear it is not forgotten and will be eventually in one of the next Updates.
~~@graphos:
The Link you provided points to c4d.gui.ActiveObjectManager_SetObject () which can only show one object. I was referring to the c++ function c4d.gui.ActiveObjectManager_SetObject s () ( notice the trailing 's' ) which is able to show an array of objects in the object manager. This function was mentioned above by Andreas.Just to be sure I tried calling the function you mentioned with an array, which, sure enough, resulted in a "TypeError: argument 2 must be c4d.Atom, not list"~~
-
On 25/10/2017 at 02:21, xxxxxxxx wrote:
Sorry to have bring false hope. I missed the "s".