Saving unsaved gcha tab in code

46 views
Skip to first unread message

Stuart Dobbs

unread,
Feb 23, 2023, 3:26:44 PM2/23/23
to Golaem List
Hi, still pretty new to golaem. Using mel/python I need to query for unsaved edits to a gcha file with the character maker and then save the edits.

I'm using 'maya.cmds.glmCharacterMaker(currentFile=True)' to get the active tab file but I can't figure out how to query whether it's currently edited/unsaved? I'd also like to save the file if it's edited but don't see a corresponding flag on glmCharacterMaker?

Thanks!


Nicolas Chaverou

unread,
Feb 23, 2023, 5:00:30 PM2/23/23
to crowd...@golaem.com
Hey Stuart,

When opening a new support ticket feel free to either use http://support.golaem.com or please provide context details such as Golaem version / Maya version / Rendering engine and version (when applicable)

See answers inlined below

On Thu, Feb 23, 2023 at 9:26 PM 'Stuart Dobbs' via Golaem List <crowd...@golaem.com> wrote:
Hi, still pretty new to golaem. Using mel/python I need to query for unsaved edits to a gcha file with the character maker and then save the edits.

I'm using 'maya.cmds.glmCharacterMaker(currentFile=True)' to get the active tab file but I can't figure out how to query whether it's currently edited/unsaved? I'd also like to save the file if it's edited but don't see a corresponding flag on glmCharacterMaker?

Check for unsaved edits / save a gcha file is not available from the command when using the UI of the tool
This having been said, the common usage is more to build your own process around character creation and use the glmCharacterMaker command to do so

May I ask for the use case ? If relevant we can probably add what's missing or provide workarounds (such as save callbacks and so on)
Best,

 

Thanks!


--
Note that crowd...@golaem.com is a public list.
If for any reason (confidential project, sending production files...) you need to post a private message to Golaem Support, please use http://support.golaem.com
---
You received this message because you are subscribed to the Google Groups "Golaem List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crowd-list+...@golaem.com.
To view this discussion on the web visit https://groups.google.com/a/golaem.com/d/msgid/crowd-list/36952654-e2d2-4197-9591-a917251d7d17n%40golaem.com.

Stuart Dobbs

unread,
Feb 24, 2023, 8:34:10 AM2/24/23
to Golaem List, Nicolas Chaverou

Hi Nicolas, The use case is:
* Artist may have been doing work in the Character Maker UI - but they have not saved, perhaps they forgot to save.
* Artist is now publishing the data to the pipeline from their Maya runtime, I need a way of 1) detecting whether they forgot to save any changes, 2) Ensuring those changes are saved prior to publishing the gcha to the pipeline.

I wasn't looking to open a support ticket but if it helps:
golaem-8.1.4 (building 8.2.2 currently)
Maya 2022

Nicolas Chaverou

unread,
Feb 27, 2023, 4:32:23 AM2/27/23
to Stuart Dobbs, Golaem List
Hey Stuart,

See inlined below

On Thu, Feb 23, 2023 at 11:43 PM Stuart Dobbs <sdo...@blizzard.com> wrote:

Hi Nicolas, The use case is:
* Artist may have been doing work in the Character Maker UI - but they have not saved, perhaps they forgot to save.
* Artist is now publishing the data to the pipeline from their Maya runtime, I need a way of 1) detecting whether they forgot to save any changes, 2) Ensuring those changes are saved prior to publishing the gcha to the pipeline.

Ok gotcha. Interestingly enough you still create Character Files through the UI :)
I'm afraid we don't provide such flags in the command at the moment but can add it to the roadmap
Is it critical for a show or desirable before a certain date ?
 
I wasn't looking to open a support ticket but if it helps:
golaem-8.1.4 (building 8.2.2 currently)
Maya 2022

Sending a mail throught the public support list crowd...@golaem.com or through the form always open a ticket :)
In this situation, as we don't have such API at the moment, that will allow us to roadmap it and keep you posted when it's available

Best,

Nicolas Chaverou

unread,
Mar 31, 2023, 6:32:40 AM3/31/23
to Stuart Dobbs, Golaem List
Hey Stuart,

Actually you guys already asked for a similar stuff in the past and I forgot we actually added some flags to help you with this in Golaem 7.3
Here's the mail I sent to your team in the past:

Here's how the API looks like for the command

import maya.cmds as cmds
print(cmds.glmCharacterMaker(openedFiles=True))  # return tab names

[u'N:\\SoldierRoman.gcha', u'N:\\SootSprite.gcha', u'Maya Skeleton: joint1']


print(cmds.glmCharacterMaker(currentFile=True))  # return current tab name

N:\RomanSoldier.gcha


# list geometry nodes of tab with a specific name
print(cmds.glmCharacterMaker(script=True, fileTab='N:\\SoldierRoman.gcha', listGeoNodes=True))
[u'RomanSoldier', u'Body', u'Clothes', u'Weapon', u'Shields', u'BodyAsset', u'ClothesAsset', u'Staff']

# saving tab with a specific name to specific file path

cmds.glmCharacterMaker(script=True, fileTab='N:\\SoldierRoman.gcha', outputFile='D:/RomanSoldier.gcha')

Hope that helps

Stuart Dobbs

unread,
Mar 31, 2023, 12:26:59 PM3/31/23
to Golaem List, Nicolas Chaverou, Golaem List, Stuart Dobbs
Thanks Nicolas, thanks for digging out those commands. Our code is making use of those flags, but there doesn't seem to be a way of determining whether a tab is modified (has unsaved changes)? - this query is the crux of my issue unfortunately.

Nicolas Chaverou

unread,
Apr 4, 2023, 10:53:31 AM4/4/23
to Stuart Dobbs, Golaem List
Hey Stuart,
Ok gotcha. Just added an extra -tabNeedsSave flag on the command which should return what you need
Will be in upcoming Golaem 8.2.3 and we will keep you posted when available
Best,

Stuart Dobbs

unread,
Apr 4, 2023, 12:36:40 PM4/4/23
to Golaem List, Nicolas Chaverou, Golaem List, Stuart Dobbs
Sweet! TY!

Nicolas Chaverou

unread,
Apr 12, 2023, 5:45:53 AM4/12/23
to Stuart Dobbs, Golaem List
Hey there,

Just to let you know that we released Golaem 8.2.3 which adds a fileTabNeedsSave flag to the glmCharacterMaker command
You can find the complete Release Notes here: http://releasenotes.golaem.com
And the related packages: http://packages.golaem.com

Hope that helps
Best,
Reply all
Reply to author
Forward
0 new messages