THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/12/2012 at 09:36, xxxxxxxx wrote:
How would I go about forcing my MoData Array to reflect the actual cloner count? As it stands, when I change the cloner count, the Array won't update until after I click in the Object Manager, at which time, the array length comes back correct.
I've tried adding c4d.EventAdd() and also resetting my array=[], but neither has any effect.
My test:
import c4d
from c4d.modules import mograph
#Welcome to the world of Python
def main() :
#ar = None
op = doc.SearchObject('Cloner') # Get cloner reference
md = mograph.GeGetMoData(op) # Get MoData on clones
ar = md.GetArray(c4d.MODATA_MATRIX) # Get array of clone matrices
print(str(op[c4d.MG_LINEAR_COUNT])) # Shows correct cloner count
print('array length: ' + str(len(ar))) # Shows incorrect array length
Thanks,
Jim