예제 #1
0
void Voxelify::DoRecursion(BaseObject *op, BaseObject *child, GeDynamicArray<Vector> &points, Matrix ml) {
	BaseObject *tp;
	if (child){
		tp = child->GetDeformCache();
		ml = ml * child->GetMl();
		if (tp){
			DoRecursion(op,tp,points,ml);
		}
		else{
			tp = child->GetCache(NULL);
			if (tp){
				DoRecursion(op,tp,points,ml);
			}
			else{
				if (!child->GetBit(BIT_CONTROLOBJECT)){
					if (child->IsInstanceOf(Opoint)){
						PointObject * pChild = ToPoint(child);
						LONG pcnt = pChild->GetPointCount();
						const Vector *childVerts = pChild->GetPointR();
						for(LONG i=0; i < pcnt; i++){
							points.Push(childVerts[i] * ml * parentMatrix);
						}
					}
				}
			}
		}
		for (tp = child->GetDown(); tp; tp=tp->GetNext()){
			DoRecursion(op,tp,points,ml);
		}
	}
}
예제 #2
0
/// ***************************************************************************
/// This function hides or unhides all materials used by the object *op*.
/// If *doc* is not \c nullptr, undos will be added.
/// ***************************************************************************
static void HideMaterials(BaseObject* op, Bool hide, BaseDocument* doc)
{
  BaseTag* tag = op->GetFirstTag();
  GeData data;
  while (tag)
  {
    if (tag->GetType() == Ttexture && tag->GetParameter(TEXTURETAG_MATERIAL, data, DESCFLAGS_GET_0))
    {
      BaseMaterial* mat = static_cast<BaseMaterial*>(data.GetLink(doc, Mbase));
      if (mat) HideHierarchy(mat, hide, doc, false);
    }
    tag = tag->GetNext();
  }
  BaseObject* child = op->GetDown();
  while (child) {
    HideMaterials(child, hide, doc);
    child = child->GetNext();
  }
}