fix 2 bugs

- fix viewer throw decorate error when a graph don't contain any bb
- fix export data error when Virtools face unrecongized data type
This commit is contained in:
yyc12345 2020-04-13 23:59:51 +08:00
parent ac033a3ae3
commit 73b7d96795
3 changed files with 11 additions and 4 deletions

View File

@ -91,7 +91,9 @@ inline void proc_pIn(CKParameterIn* cache, database* db, dbDataStructHelper* hel
helper->_db_pIn->thisobj = cache->GetID();
helper->_db_pIn->index = index;
strcpy(helper->_db_pIn->name, cache->GetName());
strcpy(helper->_db_pIn->type, helper->_parameterManager->ParameterTypeToName(cache->GetType()));
CKParameterType vaildTypeChecker = cache->GetType();
if (vaildTypeChecker != -1) strcpy(helper->_db_pIn->type, helper->_parameterManager->ParameterTypeToName(cache->GetType())); //known types
else strcpy(helper->_db_pIn->type, "!!UNKNOW TYPE!!"); //unknow type
helper->_db_pIn->type_guid[0] = cache->GetGUID().d1;
helper->_db_pIn->type_guid[1] = cache->GetGUID().d2;
helper->_db_pIn->belong_to = parents;
@ -109,7 +111,9 @@ inline void proc_pOut(CKParameterOut* cache, database* db, dbDataStructHelper* h
helper->_db_pOut->thisobj = cache->GetID();
helper->_db_pOut->index = index;
strcpy(helper->_db_pOut->name, cache->GetName());
strcpy(helper->_db_pOut->type, helper->_parameterManager->ParameterTypeToName(cache->GetType()));
CKParameterType vaildTypeChecker = cache->GetType();
if (vaildTypeChecker != -1) strcpy(helper->_db_pOut->type, helper->_parameterManager->ParameterTypeToName(cache->GetType())); //known types
else strcpy(helper->_db_pOut->type, "!!UNKNOW TYPE!!"); //unknow type
helper->_db_pOut->type_guid[0] = cache->GetGUID().d1;
helper->_db_pOut->type_guid[1] = cache->GetGUID().d2;
helper->_db_pOut->belong_to = parents;
@ -194,7 +198,9 @@ inline void proc_bLink(CKBehaviorLink* cache, database* db, dbDataStructHelper*
inline void proc_pLocal(CKParameterLocal* cache, database* db, dbDataStructHelper* helper, EXPAND_CK_ID parents, BOOL is_setting) {
helper->_db_pLocal->thisobj = cache->GetID();
strcpy(helper->_db_pLocal->name, cache->GetName() ? cache->GetName() : "");
strcpy(helper->_db_pLocal->type, helper->_parameterManager->ParameterTypeToName(cache->GetType()));
CKParameterType vaildTypeChecker = cache->GetType();
if (vaildTypeChecker != -1) strcpy(helper->_db_pLocal->type, helper->_parameterManager->ParameterTypeToName(cache->GetType())); //known types
else strcpy(helper->_db_pLocal->type, "!!UNKNOW TYPE!!"); //unknow type
helper->_db_pLocal->type_guid[0] = cache->GetGUID().d1;
helper->_db_pLocal->type_guid[1] = cache->GetGUID().d2;
helper->_db_pLocal->is_setting = is_setting;

View File

@ -145,6 +145,7 @@ def buildBlock(exDb, deDb, target, currentGraphBlockCell):
else:
layer_height[curLayer] = max(layer_height.get(curLayer, 0), bbResult[i].height)
layer_height[arrangedLayer] = layer_height.get(arrangedLayer, 0) # make sure misc bb height exist
layer_height[2] = layer_height.get(2, 0) # make sure at least have a bb layer (when there are no bb in a map)
# calc bb Y
baseY = dcv.GRAPH_CONTENTOFFSET_Y

View File

@ -4,7 +4,7 @@ import os
import sys
# debug use
os.remove('decorate.db')
# os.remove('decorate.db')
print('Super Script View')
if not os.path.isfile("decorate.db"):