I'm pretty sure the error you are seeing from this is that there are not
enough format arguments for the string? It is because in your string you
use %s two times but only provide one format argument. It would work if you
modified it to:
mm.eval("polyProjection -ch 1 -type Planar -ibd on -kir -md z
pCube%s.f[4:6] pCube%s.f[8];" % (i,i))
Also, you said you wanted to affect 4 objects, but if you do range(1,4),
that will only produce [1,2,3]
I think you could also express this through the python commands module with:
import maya.cmds as cmds
for i in xrange(1,5):
obj = "pCube%d" % i
objs = ["%s.f[4:6]" % obj, "%s.f[8]" % obj]
cmds.polyProjection(objs, ch=True, type="Planar", ibd=True,
kir=True, md="z")
On Sat, May 31, 2014 at 5:26 PM, <[email protected]> wrote:
> hello
> i want to do a planar mapping of four objects like this:
>
>
> import maya.mel as mm
> for i in range(12,15):
> mm.eval("polyProjection -ch 1 -type Planar -ibd on -kir -md z
> pCube%s.f[4:6] pCube%s.f[8];" % i)
>
>
> sadly this wont go...does anyone know how to do this ? I would be very
> thankful:)
>
> --
> 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/9c32c4d2-af4e-4164-83e6-8a9820d33133%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAPGFgA2%3D4R%3D9WevH6QZfudNuac6Tow3vfNQrtVNiE91NJz57wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.