这里先解释一下sub-object : 当你在3ds max里用create command panel 建一个物体(比如球体,方体,圆锥等),我们称此类物体为Object 。而在Object上选择的一些面,点,边,边界等为sub-object .
那么sub-object的 selection,scale,rotate ,move操作是由谁做的呢。查看3ds max sdk后,原理是有BaseObject这个类做的。
那么看看这个类吧。
BaseObject --> RefereceTarget BaseObject 的父类是RefereceTarget类。
Modifier --> BaseObject Modifier 的父类是 BaseObject类。
Object --> BaseObject Object 的父类是BaseObject类。
如果要了解BaseObject ,可以去看看3ds max sdk . 这里我简单记录一下 BaseObject的几个重要的函数:
The overall process of sub-object selection relies upon the implementation of several methods in the modifier. These methods are from class BaseObject. These involve selecting, identifying, moving, rotating and scaling sub-object components. These methods are:
() - This method is called to clear the selection for the given sub-object level. All sub-object elements of this type should be deselected.BaseObject::ClearSelection
() - This method is called to change the selection state of the component identified by hitRec.BaseObject::SelectSubComponent
() - Returns the index of the sub-object element identified by the HitRecord hitRec. The sub-object index identifies a sub-object component. The relationship between the index and the component is established by the modifier. For example, an edit modifier may allow the user to select a group of faces and these groups of faces may be identified as group 0, group 1, group 2, etc. Given a hit record that identifies a face, the edit modifier's implementation of this method would return the group index that the face belonged to.BaseObject::SubObjectIndex
() - This method is called to make a copy of the selected sub-object components.BaseObject::CloneSelSubComponents
() - When this method is called the plug-in should respond by moving its selected sub-object components.BaseObject::Move
() - When this method is called the plug-in should respond by rotating its selected sub-object components.BaseObject::Rotate
() - When this method is called the plug-in should respond by scaling its selected sub-object components.BaseObject::Scale