equal
deleted
inserted
replaced
126 |
126 |
127 """ |
127 """ |
128 Function that returns the block definition associated to the block type given |
128 Function that returns the block definition associated to the block type given |
129 """ |
129 """ |
130 |
130 |
131 def GetBlockType(type): |
131 def GetBlockType(type, inputs = None): |
132 for category in BlockTypes: |
132 for category in BlockTypes: |
133 for blocktype in category["list"]: |
133 for blocktype in category["list"]: |
134 if blocktype["name"] == type: |
134 if inputs: |
|
135 block_inputs = tuple([var_type for name, var_type, modifier in blocktype["inputs"]]) |
|
136 same_inputs = inputs == block_inputs |
|
137 else: |
|
138 same_inputs = True |
|
139 if blocktype["name"] == type and same_inputs: |
135 return blocktype |
140 return blocktype |
136 return None |
141 return None |
137 |
142 |
138 |
143 |
139 #------------------------------------------------------------------------------- |
144 #------------------------------------------------------------------------------- |