Continuing work on my project to use a mobile device's motion to draw 3D strokes within Maya. It's basically working, but I have a little glitch that is causing Maya to crash.
The iPhone app basically calls (over the network after a socket has been opened) functions I've defined in a host-side python script.
First, it creates a locator and attaches the device motion output to it, essentially moving it around the screen.
Next, pressing the record button causes playback to start with recording enabled. The user moves the device and this records the motion as keyframes. I've capped it at 100 frames.
Finally, when the user releases the button, it stops playback, converts the keyframes into a motion trail, converts that into a curve, then finally attaches a paint effects stroke to it.
Now, this last step is where the crash sometimes occurs. If the script to stop playback and initiate the curve fails to execute, the timeline plays to the end. Anything I do after that point causes Maya to crash, even opening a new scene.
What am I missing here? Is that script causing a resource conflict under the surface? How do I begin to troubleshoot something like this? Is there a way to just wait until playback ends to call the script each time, rather than trying to interrupt it (which is not reliably working)?
Thanks in advance for your help.
def recordMotion():
cmds.setKeyframe('drawLoc', at='translateX')
cmds.setKeyframe('drawLoc', at='translateY')
cmds.setKeyframe('drawLoc', at='translateZ')
cmds.currentTime((cmds.currentTime(query=True))+1)
Have you tried, as you have the connection already in there, to use the motion to control the built it grease pencil tool? It sounds like that way you get away with a lot less room for error and should get instant draw feedback if you "stagger" your connection a little bit, pulses rather than a steady stream so to say.
Sorry I can't offer any more practical help, only just started playing with the grease pencil myself but will post here if I stumble on anything to this regard.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/IPz5ByDHxH8/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To post to this group, send email to python_in...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.