Notifications
Clear all

[Closed] Grease Pencil Max script

 PEN

Geezzz, show me up or what:S I guess I got what was comming to me eh John?

Thanks bobo. I will learn alot form this as I didn’t know you could do any of that.

 PEN

Bobo, the whole selection thing is a bit of a pain. Interesting how you are going about this. Just how are you able to orbit view ports and not loose the drawing, what are you doing different then mine?

 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.

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

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.

Heya folks, thanks for the invite!

the script for maya that I wrote is a pretty nasty hack… basically I’m creating nurbs planes which are parented to the camera that are made “live” which can be drawn on with a curve tool.

So when you add a “draw frame”, it creates a nurbs plane, parents it to the camera, sets it live, and then puts you in the pencil tool.

The nifty bit, though, is making it so onion skinning works (just templating the previous and next frames) and allowing you to modify the timing of your animation quickly by moving keys around in the text scroll list.

Also, having layers of drawings is incredibly helpful…

I’d like to add line width and color in the future.

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?

 PEN

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.

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.

sounds impressive, bobo!

wish I had max so I could try it out! haha

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?

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

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.

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!

Page 2 / 5