On 27/10/2015 at 10:12, xxxxxxxx wrote:
Hi Pim,
This is an example of how I would move the data from a python tag to an interaction tag:
First the python tag:
# Set up the function that is going to be called from the other python object
def GetMatrix() :
if not matrix: return None
bc = c4d.BaseContainer()
bc.SetMatrix(0, matrix)
return bc
matrix = None
def main() :
obj = op.GetObject()
global matrix
#Assign the global variable with some data
matrix = obj.GetMg()
And then the Interaction tag:
def draw(bd) :
# The python object you want to call the function from
py_op = op[c4d.ID_USERDATA,1]
# Call the function from the python tag to get the BaseContainer
bc = c4d.CallFunction(py_op, "GetMatrix")
#Get the matrix
matrix = bc.GetMatrix(0)
#Do stuff!
print matrix
Hope that's useful.
Thanks,
Adam