fix various bugs including exporting and analysing
This commit is contained in:
parent
ec128f3b9c
commit
a27b87af79
|
@ -82,7 +82,7 @@ class BlocksFactory(object):
|
||||||
# read datas
|
# read datas
|
||||||
for (output_obj, output_type, output_is_bb, ) in envir.m_Cursor.fetchall():
|
for (output_obj, output_type, output_is_bb, ) in envir.m_Cursor.fetchall():
|
||||||
# check dup
|
# check dup
|
||||||
if output_obj in envir.m_WalkedOper or output_obj not in self.__AllOper:
|
if output_obj in envir.m_WalkedOper:
|
||||||
continue
|
continue
|
||||||
envir.m_WalkedOper.add(output_obj)
|
envir.m_WalkedOper.add(output_obj)
|
||||||
|
|
||||||
|
@ -91,7 +91,8 @@ class BlocksFactory(object):
|
||||||
opers.add(output_obj)
|
opers.add(output_obj)
|
||||||
else:
|
else:
|
||||||
# this oper point to non-pIn, should be add into result
|
# this oper point to non-pIn, should be add into result
|
||||||
results.add(output_obj)
|
if envir.m_Depth != 0: # omit BB
|
||||||
|
results.add(envir.m_QueryOper)
|
||||||
|
|
||||||
# recursive calling opers to get root
|
# recursive calling opers to get root
|
||||||
for oper in opers:
|
for oper in opers:
|
||||||
|
@ -180,7 +181,7 @@ class BlocksFactory(object):
|
||||||
# we need add it manually
|
# we need add it manually
|
||||||
self.__AllOper.remove(operid)
|
self.__AllOper.remove(operid)
|
||||||
bb.m_LowerOper.NewLayer(DecoratorData.TreeLayout.NO_REFERENCE_LAYER, DecoratorData.TreeLayout.NO_START_POS_OF_REF_LAYER)
|
bb.m_LowerOper.NewLayer(DecoratorData.TreeLayout.NO_REFERENCE_LAYER, DecoratorData.TreeLayout.NO_START_POS_OF_REF_LAYER)
|
||||||
bb.m_LowerOper.NewItem(self.m_Graph.m_BBDict[operid])
|
bb.m_LowerOper.NewItem(self.m_Graph.m_OperDict[operid])
|
||||||
|
|
||||||
# gotten "root" is oper's CKID, so use depth 1 to cheat this function
|
# gotten "root" is oper's CKID, so use depth 1 to cheat this function
|
||||||
self.__RecursiveBuildOper(BuildOperEnvironment(
|
self.__RecursiveBuildOper(BuildOperEnvironment(
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace SSMaterializer {
|
||||||
CKParameter* directSource = NULL;
|
CKParameter* directSource = NULL;
|
||||||
CKObject* ds_Owner = NULL;
|
CKObject* ds_Owner = NULL;
|
||||||
CKParameterIn* sharedSource = NULL;
|
CKParameterIn* sharedSource = NULL;
|
||||||
CKBehavior* ss_Owner = NULL;
|
CKObject* ss_Owner = NULL;
|
||||||
|
|
||||||
// first, we analyse eLink
|
// first, we analyse eLink
|
||||||
// check whether this is export parameter and write to database
|
// check whether this is export parameter and write to database
|
||||||
|
@ -113,23 +113,40 @@ namespace SSMaterializer {
|
||||||
if (sharedSource = analysed_pin->GetSharedSource()) {
|
if (sharedSource = analysed_pin->GetSharedSource()) {
|
||||||
//pIn from BB
|
//pIn from BB
|
||||||
mDb->mDbHelper.script_pLink.input = sharedSource->GetID();
|
mDb->mDbHelper.script_pLink.input = sharedSource->GetID();
|
||||||
ss_Owner = (CKBehavior*)sharedSource->GetOwner();
|
ss_Owner = sharedSource->GetOwner();
|
||||||
mDb->mDbHelper.script_pLink.input_obj = ss_Owner->GetID();
|
mDb->mDbHelper.script_pLink.input_obj = ss_Owner->GetID();
|
||||||
|
|
||||||
if (ss_Owner->IsUsingTarget() && (ss_Owner->GetTargetParameter() == sharedSource)) {
|
switch (ss_Owner->GetClassID()) {
|
||||||
//pTarget
|
case CKCID_BEHAVIOR: // CKBehavior
|
||||||
mDb->mDbHelper.script_pLink.input_type = DataStruct::pLinkInputOutputType_PTARGET;
|
{
|
||||||
mDb->mDbHelper.script_pLink.input_is_bb = TRUE;
|
if (((CKBehavior*)ss_Owner)->IsUsingTarget() && (((CKBehavior*)ss_Owner)->GetTargetParameter() == sharedSource)) {
|
||||||
mDb->mDbHelper.script_pLink.input_index = -1; // omit
|
//pTarget
|
||||||
|
mDb->mDbHelper.script_pLink.input_type = DataStruct::pLinkInputOutputType_PTARGET;
|
||||||
|
mDb->mDbHelper.script_pLink.input_is_bb = TRUE;
|
||||||
|
mDb->mDbHelper.script_pLink.input_index = -1; // omit
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//pIn
|
//pIn
|
||||||
mDb->mDbHelper.script_pLink.input_type = DataStruct::pLinkInputOutputType_PIN;
|
mDb->mDbHelper.script_pLink.input_type = DataStruct::pLinkInputOutputType_PIN;
|
||||||
mDb->mDbHelper.script_pLink.input_is_bb = TRUE;
|
mDb->mDbHelper.script_pLink.input_is_bb = TRUE;
|
||||||
mDb->mDbHelper.script_pLink.input_index = ss_Owner->GetInputParameterPosition(sharedSource);
|
mDb->mDbHelper.script_pLink.input_index = ((CKBehavior*)ss_Owner)->GetInputParameterPosition(sharedSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case CKCID_PARAMETEROPERATION: // CKParameterOperation
|
||||||
|
{
|
||||||
|
//pOper only have pIn.
|
||||||
|
mDb->mDbHelper.script_pLink.input_type = DataStruct::pLinkInputOutputType_PIN;
|
||||||
|
mDb->mDbHelper.script_pLink.input_is_bb = TRUE;
|
||||||
|
mDb->mDbHelper.script_pLink.input_index = ((CKParameterOperation*)ss_Owner)->GetInParameter1() == sharedSource ? 0 : 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// the unexpected value. according to SDK manual,
|
||||||
|
// there are only 2 possible types
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the header of pLink has been analysed successfully,
|
// if the header of pLink has been analysed successfully,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user