//// IsMovable ///////////////////////////////////////////////////////////////
//  Returns whether this node is "animated" (i.e. could move at runtime)
hsBool plMaxNodeBase::IsMovable()
{
    const char* dbgNodeName = GetName();
    hsBool      shouldBe = false;


    if( !CanConvert() )
        return false;

    if( GetMovable() )
        return true;

    if( GetItinerant() )
        shouldBe = true;
    else if( FindSkinModifier() )
        shouldBe = true;

    // Moved this to plAnimComponent (so GetMovable() will reveal it)
    /*
    else if( IsTMAnimated() )
        shouldBe = true;
    */
    if( shouldBe )
    {
        SetMovable( true );
        return true;
    }

    return ((plMaxNodeBase*)GetParentNode())->IsMovable();
}
Beispiel #2
0
bool CMaxMesh::Create(INode *pINode, Mesh *pIMesh, bool bDelete)
{
    // check for valid mesh
    if(pIMesh == 0)
    {
        theExporter.SetLastError("Invalid handle.", __FILE__, __LINE__);
        return false;
    }

    m_pINode = pINode;
    m_pIMesh = pIMesh;
    m_bDelete = bDelete;

    // recursively create materials
    if(!CreateMaterial(m_pINode->GetMtl())) return false;

    // build all normals if necessary
    m_pIMesh->checkNormals(TRUE);

    // precalculate the object transformation matrix
    m_tm = m_pINode->GetObjectTM(SecToTicks(theExporter.GetInterface()->GetCurrentTime()));

    // try to get the physique modifier
    m_pModifier = FindPhysiqueModifier(pINode);
    if(m_pModifier == 0)
    {
        // try to get the skin modifier
        m_pModifier = FindSkinModifier(pINode);
        if(m_pModifier == 0)
        {
                  m_pModifier = FindMorpherModifier(pINode);
                  if( m_pModifier == 0 ) {
                    m_modifierType = MODIFIER_NONE;
                  }
                  m_modifierType = MODIFIER_MORPHER;
        }
        else
        {
            m_modifierType = MODIFIER_SKIN;
        }
    }
    else
    {
        m_modifierType = MODIFIER_PHYSIQUE;
    }

    return true;
}