Selection Order Bug

On 22/07/2014 at 06:06, xxxxxxxx wrote:

We are building custom plugins for C4D. On of them takes a selection order, then aligns user data of the objects. This plugin is based on the selection order in the object browser, however, the objects aren't being selected properly. For example, if you select the first object in the browser, then shift click to the last object, it should select from top to bottom. Instead, it is doing a random order therefore not allowing the plugin to work properly. The only workaround would be to manually click each object down the list, which would be quite tedious if there are 50+ items.

Maxon support has confirmed this as a bug in R15.057. Does that mean it should be fixed in the next update? Also, does anyone know a better workaround until they fix it?.

On 22/07/2014 at 07:35, xxxxxxxx wrote:

What are you using to get the list of selected objects? I'd guess it's BaseDocument::GetActiveObjects(), with flag GETACTIVEOBJECTFLAGS_SELECTIONORDER set?

You might have to build your own ordered list. You could use GetFirstObject(), then BaseObject::GetNext() to iterate through all objects in the scene. If any objects matches an object in the selection, add it to your own list. At the end you should have all the selected objects in the order in which they appear in the OM.