Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Avoid duplicate references with cmds.file

Avoid duplicate references with cmds.file

Anonymous
Not applicable
416 Views
0 Replies
Message 1 of 1

Avoid duplicate references with cmds.file

Anonymous
Not applicable

Dear all,

I'm new to maya programming, writing a tool to reference alembics into scene using then group them with same alembic name.

so I'm using groupReference, then I get a group suffixed with "RNgrp" to get rid of this, Im passing group name of my own. 

Now my issue is, if I try to reference same alembic again, it appends versionsup the group name like "testabc1, testabc2" . I do not want to duplicate, if the referenc exists, it should avoid referencing. I tryed dns flag and someother. I forgot which combination of flags it was 😞  Thank you for reading. 

 

cmds.file(
filename,
reference=True, 
type="Alembic",
namespace=ns[0], 
groupReference=True, 
ignoreVersion=True,
dns=False,
mergeNamespacesOnClash=False,
groupName=versionless_abc_path 
)
0 Likes
417 Views
0 Replies
Replies (0)