Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi,
the description for this tag is obviously being built dynamically. By poking around in the editor, you can find out that the field Target in the tab Parent is starting at the id 30001 and placed with a stride of 10. So the next ids would be at 30011, 30021, etc.
30001
10
30011
30021
To test up to which point your tag has been populated, you should enumerate all possible ids consecutively and test for each if the data container of your tag contains an element of the type BaseLink at that id. When an id fails this test, you know you have reached the end, i.e. the last id in your enumeration was the last valid id. The code could look something like this:
BaseLink
cid = 30001 result, data = [], constraint_tag.GetData() while True: if not data.GetType(cid) is c4d.DA_ALIASLINK: break result.append(cid) cid += 10
Cheers, zipit
While the method provided by Zipit Is fine, it is not 100% reliable.
here how to achieve, unfortunately, the ELEMENT_Count value is hardcoded and no way for you to retrieve it.
constraintTag = doc.GetActiveTag() targetCount = constraintTag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_TARGET_COUNT] for i in range(targetCount): CONSTRAINT_ELEMENT = 10 # This is hardcoded targetId = c4d.ID_CA_CONSTRAINT_TAG_PARENT_TARGET_COUNT + i * CONSTRAINT_ELEMENT + 1 print(constraintTag[targetId])
Cheers, Maxime.