c4d.AliasTrans¶
-
class
c4d.
AliasTrans
¶ The alias translator takes care about reconnecting BaseLink links when cloning, copying, reading or writing objects.
New in version R17.032.
Normally Cinema 4D provides an alias translator when needed, for example in
NodeData.CopyTo()
. However, to copy objects manually use:trans = c4d.AliasTrans() if not trans or not trans.Init(doc): return False clone = op.GetClone(c4d.COPYFLAGS_NONE, trans) if not clone: return False trans.Translate(True)
Methods Signatures
Initializes the alias translator in the specified document doc. |
|
Translates the links in all objects that the translator has come across. |
Methods Documentation
-
AliasTrans.
Init
(self, doc)¶ Initializes the alias translator in the specified document doc.
- Parameters
doc (c4d.documents.BaseDocument) – The document.
- Return type
bool
- Returns
True if the alias translator was initialized, otherwise False.
-
AliasTrans.
Translate
(self, connect_oldgoals)¶ Translates the links in all objects that the translator has come across.
- Parameters
connect_oldgoals (bool) –
True to connect old goals.For example: Take a cube with an instance linked to this cube, select both and duplicate them in one action.The new cube is linked to the new instance if connect_oldgoals is True.If it is False the new instance is linked to the old cube.