Hi @mocoloco,
Does the FileName have to start with asset::///?
No, I only used an asset here so that example runs on any machine (and does not require a specific file on a local volume).
The string assetUrl
is deliberately named this way, because we effectively define a maxon.Url
here. The parameter ID_CA_XREF_FILE
is of type Filename
. The type does not explicitly exist in the Python API and is instead represented by str
. Internally, all Filename
are however converted to and represented as maxon::Url
. Filename
is just a classic API thin wrapper for maxon::Url
.
asset:///
is the scheme of this URL and maxon::Url
supports many schemes; asset
and file
are just two of them. To define a URL in the file scheme you can either do it implicitly, provide no scheme, or be explicit.
assetUrl: str = r"E:/cube.c4d" # Implicitly in the file scheme
assetUrl: str = r"file:///E:/cube.c4d"
it seems mandatory to have c4d.DESCFLAGS_SET_USERINTERACTION to set the parameter. I assume that's the case for all the parameters accessible by the user in a Ge.
I am not sure what you meant with 'Ge', but in general that is not the case. In most cases you can use GeListNode.__getitem__
and GeListNode.__setitem__
to access parameters. For more complex parameter access you sometimes need C4DAtom.Get/SetParameter
, usually with the flags DESCFLAGS_GET_NONE
and DESCFLAGS_SET_NONE
. It is only in very rare cases that you have to simulate a user interaction with DESCFLAGS_SET_USERINTERACTION
. This happens when the internal data of a node is much more complex than its parameters make it look like and the node must manage the data on each parameter change. Oxref
is an example and also the new Orscamera
, i.e., the new standard camera.
One more question; I'm continuing to explore XRef and I can't really find if there returned value or flag by XRef when the object is correctly loaded.
I do not think so, that would be very uncharacteristic for the classic API. Message streams are there sealed, i.e., not accessible for outside observers. Sometimes nodes write a state into a hidden parameter, but looking at the Xref description I cannot see such parameter.
Where would that be relevant for you? Once you have passed the EventAdd()
in my script, the object should be finalized. You could technically also send xref.Message(c4d.MSG_CHANGE)
to the atom, but this is a bit pointless since you do not get a response for this message and the node is updating anyways.
Cheers,
Ferdinand