Hi Aren,
Just from first glance, it looks like your path is incorrect. Remember to
use \\ when using strings in Python.
ifl='P:\\BsMaps\\half_l.tif'
in the code above you have pm, not sure what that variable is meant to be
in your example
Tests I got working:
# export
# I had the UI tool open
import maya.cmds as cmds
ctx = cmds.currentCtx() # Result: artAttrColorPerVertexContext #
cmds.artAttrPaintVertexCtx(ctx, e=True,
exportfilesave='//home//users//simonan//half_l.tif',
importfilemode='luminance')
# import file
# I had the UI tool open
import maya.cmds as cmds
ctx = cmds.currentCtx()
cmds.artAttrPaintVertexCtx(ctx, e=True,
importfileload='//home//users//simonan//half_l.tif',
importfilemode='luminance')
Docs dont have an e variable in them, but the e seems to make it work.
I hope that helps
On Wednesday, 13 September 2017 07:59:20 UTC+10, Aren Voorhees wrote:
>
> Hello all,
>
> I'm trying to import a blendshape attribute map from a texture file. I
> expect I must be going about it the wrong way though as I can't seem to get
> it to work no matter how I try it. Here is what I'm doing currently:
>
> import maya.cmds as cmds
>
> cmds.artAttrPaintVertexCtx('artAttrBlendShapeContext')
> ctx = pm.currentCtx()
> cmds.setToolTo(ctx)
> cmds.artAttrPaintVertexCtx(ctx, ifl='P:\BsMaps\half_l.tif',
> importfilemode='luminance')
>
> I'm getting this:
>
> // Error:
>
> # Traceback (most recent call last):
>
> # File "<maya console>", line 2, in <module>
>
> # RuntimeError: //
>
> FWIW, the page I'm trying to use for reference -
> http://download.autodesk.com/us/maya/2011help/CommandsPython/artAttrPaintVertexCtx.html
>
> If anyone has done this before, or knows what I'm doing wrong, a hint
> would be amazing!
>
> Thanks
>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/676ba0cb-c3cc-4c7b-b894-559086a8851e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.