Grease Pencil Max script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Display Modes
  03 March 2006
From what I understand, the really cool thing about the Disney version of this tool is that you can draw over a chain of bones and the bones will align themselves, as much as possible, to the line. So, for example, you have a spine setup with a few bones in a chain, or a some tentacles or a tail, and you draw on the viewport, the bones will rotate to match the curve. I'm guessing you'd have to draw in at least two viewports, like the front and side, to rotate the bone chain in three dimensions.

How's that for a challenge?
 
  03 March 2006
Thanks for dropping in Jason. That does sound a bit of a hack but hey if it works. We are doing it in Max by drawing to the viewport and not creating geometry. I havn't looked at line thickness or transparency but that could be interesting but I don't know if it can be done with this method.

I'm sure Bobo will find a way though.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2006
Originally Posted by PEN: I think I see. You are saving the array of lines to persistent data and then redrawing them. Very cool. Please let me know if I'm on the right track. The selection mode drives me nuts but very cool.


I changed it so it freezes all objects when you enter the pencil mode, so you don't select anything accidently. With "show frozen in gray" enabled, of course...

Here is the latest version with:

*Support of drawings per frame (relative to the first frame in the segment)
*Frame Offset to define the start frame or shift the animation
*Onion Skinning (currently up to 5 frames) with user-defined color reduction per layer
*Copying of a whole frame to the next frame
*Instancing (!) of a whole frame to the next frame - drawing in either frame will update both
*Deleting a specified stroke - if the current stroke > 0, it will be shown in the Onion Skin color reduction factor
*Copying a specified stroke to the next frame - using the same number as above
*Changing the color of a selected stroke - using the same number as above
*Deleting one frame or all frames
*Deleting Last Stroke is still there as a quick undo.

I also added << and >> buttons for quickly sliding in time. Hold Shift to jump to first/last frame of the segment.

Same place, same file.
__________________
Bobo

Last edited by Bobo : 03 March 2006 at 05:48 PM.
 
  03 March 2006
I'd love to do it by drawing directly into an imageplane & saving the files as images.. but maya doesn't have the ability to do that right now, or at least I can't figure out how to get it to.

the nice thing about doing it as geometry, however, is that it saves with the file & you can export it & bring it into other files, too.
__________________
jason schleifer
Animator - http://jasonschleifer.com/
Co-Founder - http://www.nimblecollective.com
 
  03 March 2006
sounds impressive, bobo!

wish I had max so I could try it out! haha
__________________
jason schleifer
Animator - http://jasonschleifer.com/
Co-Founder - http://www.nimblecollective.com
 
  03 March 2006
Bobo, I've read posts on the public Max webboard saying that persistent globals == bad, but I notice you're using them here. I've been using custom attributes on the root node to store persistent data because of Larry's warnings about persistent globals. Is it really not that big of an issue?
 
  03 March 2006
Originally Posted by jschleifer: I'd love to do it by drawing directly into an imageplane & saving the files as images.. but maya doesn't have the ability to do that right now, or at least I can't figure out how to get it to.

the nice thing about doing it as geometry, however, is that it saves with the file & you can export it & bring it into other files, too.


I used to have a "Freehand Spline" script that would have been rather useful to mimic what you did in Maya.
http://www.scriptspot.com/bobo/mxs2/freehandspline/

My current version uses virtual painting in the graphics window, so it is rather tricky to edit after the fact, but it is great for leaving notes in animation files. It reminds me of the way Cinesync works with Quicktime files.

I have a full bitmap painting utility as an example in the MAXScript Reference. (I wrote it in a similar fashion after somebody asked on a forum how to draw in a bitmap). It supports brush sizes and shapes, spray, texture coordinates unwrapping (with sprayed brushes these look very cool ), erasor and painting on scene objects in 3D. I could use that code to paint on an image plane with alpha channel the way I did here:
http://www.scriptspot.com/bobo/mxs6/VolumePreview/

So there are at least 3 approaches to get a painting in the viewport.
My current prototype just felt easier and more fun at this point.

Thanks for the inspiration!
__________________
Bobo

Last edited by Bobo : 03 March 2006 at 05:59 PM.
 
  03 March 2006
Originally Posted by JHaywood: Bobo, I've read posts on the public Max webboard saying that persistent globals == bad, but I notice you're using them here. I've been using custom attributes on the root node to store persistent data because of Larry's warnings about persistent globals. Is it really not that big of an issue?


Bad is relative. Only Sith speak in absolutes.
Persistent globals have issues. For example, if you start merging a file and cancel, the persistent globals from that file would overwrite your current ones.
But I have never had any specific problems dealing with them, probably because the data I store in them is not really vital. I tend to store some tool-specific data so when a tool is reopened, it can find the last settings etc. It is not a big deal if the tool would reset back to defaults, but in 99.9% of the cases it works for me.
Also, I work in a relatively closed environment and I am nearly the only full-time scripter at Frantic (with Chris Harvey jumping in when needed), so I feel I know what I am doing.

In general though, Larry is right and I am wrong. Always.
__________________
Bobo
 
  03 March 2006
Originally Posted by JHaywood: From what I understand, the really cool thing about the Disney version of this tool is that you can draw over a chain of bones and the bones will align themselves, as much as possible, to the line. So, for example, you have a spine setup with a few bones in a chain, or a some tentacles or a tail, and you draw on the viewport, the bones will rotate to match the curve. I'm guessing you'd have to draw in at least two viewports, like the front and side, to rotate the bone chain in three dimensions.

How's that for a challenge?


That psycho kees rijnen has done that already...
 
  03 March 2006
Originally Posted by joconnell: That psycho kees rijnen has done that already...


Waaaaa????? Where's that script!?
 
  03 March 2006
It was in a thread somewhere - Drop him a quick mail. He showed a video of a tool that did that which only worked with aniamte off though I think...
 
  03 March 2006
Originally Posted by Bobo: Bad is relative. Only Sith speak in absolutes.
Persistent globals have issues. For example, if you start merging a file and cancel, the persistent globals from that file would overwrite your current ones.
But I have never had any specific problems dealing with them, probably because the data I store in them is not really vital. I tend to store some tool-specific data so when a tool is reopened, it can find the last settings etc. It is not a big deal if the tool would reset back to defaults, but in 99.9% of the cases it works for me.
Also, I work in a relatively closed environment and I am nearly the only full-time scripter at Frantic (with Chris Harvey jumping in when needed), so I feel I know what I am doing.

In general though, Larry is right and I am wrong. Always.


Just read in the help that this isn't the case in Max 8 anymore.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2006
If any one cares here is my meger attempt. Thanks for the inspiration Bobo. I always learn from you. Mine doesn't have half the features of Bobo's, but hey, I'm not Bobo. I took a different approch to the drawing so you have to go in and out of drawing mode to change colours and navigate the viewport.

http://paulneale.com/scripts/PEN_whiteBoard.zip
__________________
Paul Neale
http://paulneale.com
 
  03 March 2006
Of course now I'm seeing some odd errors. Can some one please test this for me and tell me if they get any errors? I can draw with it but eventualy I start to get errors.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2006
Ok I have some huge problems with this. If the curser leaves the viewport while drawing it will cause a line to be drawn down to the corner of the viewport. Often it will crash Max and I just got it to restart my computer for me.
__________________
Paul Neale
http://paulneale.com
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:09 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.