I had intended to give a new group the same layer as its components, and if they are not all the same layer give the group the default layer. But it look like this doesn't work. I'll fix that.
I think that's not the issue in this scenario. As far as I can tell the grouping is working (apart from the
"materials""
visibility issue), and I don't think I've encountered too many other issues with grouping but that said, I'm not sure if I've ever actually tried to group objects that are in multiple layers, which I guess is where this particular ambiguity would arise. I'm not sure what the best solution is in that scenario.
As for the visibility issue, if either the layer of the group or the layer of the component is hidden, then the component will not be shown. I.e. they both need to be enabled to see the component. So in your image 3 layer 0 is still hidden so the group is hidden even if it;s components have layer 6 which is not hidden..
I think that this indicates that you and I maybe have fundamentally different ways of thinking about the purpose of "layers".
I think that this statement:"
if either the layer of the group or the layer of the component is hidden, then the component will not be shown" is the issue really because (at least for me) this causes great confusion because of the way I think about the purpose of "Layers", as I'll explain below.
I actually didn't realize this was the case, but in my opinion, the idea that a component and a group containing that component can have different layers is bound to cause confusion wrt. visibility, as well as other ambiguous situations for which you're trying to find a solution.
The paradigm I think of is similar to the typical concept of "layers" in an architectural drafting program (eg. Archicad, etc) where objects of a certain type or "class" are assigned to a particular "layer" (eg. layers might be called: electrical, plumbing, landscaping, etc) and components within a particular layer may or not be "grouped" together into larger assemblies. At any time a particular layer can be made visible or not.
In that sort of program, objects would tend not to switch between layers in most cases (at least not very often). Conversely, layers would be made visible/invisible frequently.
Those programs typically allow an essentially unlimited number of "user-defined" layers.
Anim8or, as a general purpose modeling program, perhaps needs to be a little more generic than that, however it seems to me that the "uncertainty" about what to do in certain circumstances arises from the fact that objects from different layers can be grouped together.
Perhaps this area needs some rationalization and a clear definition of the purpose of grouping and of layers.
It seems to me that the act of grouping components is a deliberate act which implies the designer has some idea of a common purpose for that "assembly" of components, in which case, I think that the group and it's components should always have the same layer.
YMMV of course, but the comments above describe the way that I think about this.
A few simple restrictions/changes might simplify things and remove the "uncertainties" about layer choices:
- You can only group components (and/or other groups) that are already all in the same layer. (The new group stays in that layer initially, but can later be moved into another layer if desired ... in which case #2 below will apply).
- The component meshes and / or any sub-groupings will always inherit the current layer of the topmost group if and when it changes layer (the layer would propagate down through the hierachy). If un-grouped on a later date, the subordinate groups/components will remain in that layer initially.
- Obviously when a group or component is "released from it's captivity in a top-order group", it then once again becomes a top-order object itself, which means that it can once again be directly assigned to a different layer. In which case rule 2 would apply to it's subordinate objects (if any), if and when it 's layer is changed.
It follows from these rules I think, that a change of layer can only occur from a decision and deliberate action on the part of the model designer. Anim8or will ensure that objects stay in the current layer when un-grouped, and therefore as a developer you no longer have to worry about what the best action is (wrt. layer choice) in a myriad of group/ungroup scenarios. It's up to the designer and whatever their workflow is, to manage the layer location of all (and only) top-level components, whether they are unconstrained meshes, or grouped assemblies.
The part which would be enforced by Anim8or is the requirement for all subordinates to inherit the layer of the top-parent (at all times).
Currently: Groups don't have materials - they are just a container. So you can't assign them a material. Would you like to be able to assign a material to all components in this dialog?
I think that would probably make sense, although this I think should be only an optional action with a warning (rather than the mandatory inheritance I suggest for layers), as there's probably many scenarios, where components or sub-groups would already have materials assigned which you would most of the time want to keep.
This could be a dangerous option, but might provide some flexibility and efficiency in the assignment of materials, and hopefully will also solve the issue where materials are lost when things are grouped. (Note: this implies the "Material" on a group will need to indicate something like "multiple" when the sub-ordinate materials have NOT been over-written.)
One "buyer-beware" that occurs to me is: how will this capability impact on UV-mapping (or visa-versa)?BTW. I seem to remember being able to assign materials to groups in 0.95 / 0.98. You might want to check that, as this might be either a bug or regression ... or maybe you made a deliberate decision to change this at some point (I'm certainly not aware of all the changes you've been making lately.)
... or my memory is flawed!
Bear in mind also, that this model has a rather unknown origin and history and has been initially separated via the new Build -> Split Solids functionality, so although unlikely, it's possible that some of the behavior I'm seeing may be due to an issue with either the model or the new code.
It does look more like an Anim8tor issue though, but I suggest you confirm independently with another model (if you haven't already) before doing a whole lot of code changes.
NOTE: I'm not asking you to make these changes before Christmas of course. I wouldn't ruin your Christmas like that! ... and some of my suggestions are probably significant enough that you should probably stew on them for a while to consider all the ramifications, and also allow other people's viewpoints/opinions.Merry Christmas!
CC