Set tokens from python

Vexus related Support Questions

Set tokens from python

Postby mois.moshev » Wed May 09, 2018 3:40 am

As the title said, is it possible to set tokens from python?
If not, consider it a feature request :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mois Moshev <mois.moshev@bottleshipvfx.com>
Pipeline Developer
Bottleship VFX
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mois.moshev
 
Posts: 12
Joined: Thu May 03, 2018 7:29 am

Re: Set tokens from python

Postby jokermartini » Thu May 10, 2018 7:09 am

Are you trying to set tokens using MaxPlus Python?
Is that what you are trying to do?

More details on what you want to do will be easier to put together a solution or example.
jokermartini
 
Posts: 31
Joined: Sat Sep 10, 2016 12:59 pm

Re: Set tokens from python

Postby mois.moshev » Thu May 10, 2018 7:15 am

Well, any way that works would be fine. I am using both MaxPlus and pymxs.
So perhaps the right solution would be to define a maxscript set_token function?

I just thought there might be a python api for this already..
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mois Moshev <mois.moshev@bottleshipvfx.com>
Pipeline Developer
Bottleship VFX
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mois.moshev
 
Posts: 12
Joined: Thu May 03, 2018 7:29 am

Re: Set tokens from python

Postby boomer » Fri May 11, 2018 2:52 pm

Mois,

You are aware that there is Maxscript Token node, right? Would that work in the meantime?
boomer
Site Admin
 
Posts: 245
Joined: Fri Aug 11, 2006 9:03 pm

Re: Set tokens from python

Postby jokermartini » Fri May 11, 2018 2:52 pm

You can currently do this with the Maxscript Token node. have you tried that at all?
We can skype and go over it if you want.
jokermartini
 
Posts: 31
Joined: Sat Sep 10, 2016 12:59 pm

Re: Set tokens from python

Postby mois.moshev » Mon May 14, 2018 1:10 am

That's why I am asking about Python, since I know there is a Maxscript Token node.
We could have an online discussion later on - we are still too early in the process, and just jabbing at the program, exploring.

btw we already have a python library that we import and use in Maxscript anyway, so the Maxscript node might be just fine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mois Moshev <mois.moshev@bottleshipvfx.com>
Pipeline Developer
Bottleship VFX
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mois.moshev
 
Posts: 12
Joined: Thu May 03, 2018 7:29 am

Re: Set tokens from python

Postby boomer » Mon May 21, 2018 5:01 pm

Mois,

Adding a Python Token node is under consideration for a future release.
boomer
Site Admin
 
Posts: 245
Joined: Fri Aug 11, 2006 9:03 pm

Re: Set tokens from python

Postby mois.moshev » Tue May 22, 2018 6:35 am

Cool, thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mois Moshev <mois.moshev@bottleshipvfx.com>
Pipeline Developer
Bottleship VFX
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mois.moshev
 
Posts: 12
Joined: Thu May 03, 2018 7:29 am

Re: Set tokens from python

Postby boomer » Tue May 22, 2018 8:34 pm

Mois,

After further investigation, we have discovered that this is not possible within the MAX SDK. However, we have a work around that should do this trick: Create a Python snippet node as a child node to a MXS Token Node. The Python node would set a MaxScript global and the MXS Token Node would simply return that global value.

Attached is simple sample that sets the name of a render element based on a token created in Python.

Please let me know if this solution works for you.
Attachments
PythonToken.zip
Sample graph setting tokens using Python and MXS Global variables
(1.17 KiB) Downloaded 153 times
Mathew Kaustinen
Boomer Labs
boomer
Site Admin
 
Posts: 245
Joined: Fri Aug 11, 2006 9:03 pm


Return to Vexus

Who is online

Users browsing this forum: No registered users and 1 guest

cron