EgtGeomKernel :
- piccola miglioria a Relocate.
This commit is contained in:
+6
-7
@@ -1095,12 +1095,11 @@ GeomDB::Relocate( int nId, int nRefId, int nSonBeforeAfter, bool bGlob)
|
||||
if ( pNewGroup == nullptr)
|
||||
return false ;
|
||||
|
||||
// se riferimento al padre e vecchio e nuovo padre coincidono, non devo fare alcunché
|
||||
if ( IS_GDB_SON( nSonBeforeAfter) && pGroup->m_nId == pNewGroup->m_nId)
|
||||
return true ;
|
||||
// verifico se l'oggetto rimane nello stesso gruppo
|
||||
bool bSameGroup = ( pGroup->m_nId == pNewGroup->m_nId) ;
|
||||
|
||||
// se rilocazione in globale
|
||||
if ( bGlob) {
|
||||
// se cambia gruppo e rilocazione in globale
|
||||
if ( ! bSameGroup && bGlob) {
|
||||
// recupero il riferimento del sorgente
|
||||
Frame3d frCurr ;
|
||||
if ( ! pGroup->GetGlobFrame( frCurr))
|
||||
@@ -1128,9 +1127,9 @@ GeomDB::Relocate( int nId, int nRefId, int nSonBeforeAfter, bool bGlob)
|
||||
return false ;
|
||||
}
|
||||
|
||||
// se il materiale è ereditato, notifico che può essere cambiato
|
||||
// se cambia gruppo e il materiale è ereditato, notifico che può essere cambiato
|
||||
int nMat ;
|
||||
if ( ! pGdbObj->GetMaterial( nMat) || nMat == GDB_MT_PARENT)
|
||||
if ( ! bSameGroup && ( ! pGdbObj->GetMaterial( nMat) || nMat == GDB_MT_PARENT))
|
||||
pGdbObj->OnSetMaterial() ;
|
||||
|
||||
return true ;
|
||||
|
||||
Reference in New Issue
Block a user