PDA

View Full Version : PEN Control objects beta.


PEN
05-14-2008, 09:23 PM
Wonder if you guys could have a look at this for me and tell me what you think. It is a scripted helper object with a pile of display options. Not all of them are hooked up and I might do several more. Also allows for you to pick custom geometry so you can use any shape that you want for the helpers.

http://paulneale.com/scripts/penControls/PEN_controls.ms

You can either just temporarily execute it or you drop it in your plugins directory. All feed back welcome.

The above had been replaced with http://forums.cgsociety.org/showpost.php?p=5152564&postcount=13

PEN
05-15-2008, 12:12 AM
Just had another thought on this as I was driving home. What if all the options for display were saved to an XML file so you could build your own library, what do you think.

erilaz
05-15-2008, 12:20 AM
Just had another thought on this as I was driving home. What if all the options for display were saved to an XML file so you could build your own library, what do you think.

Oooh. Yeah, go on, do that! :D

I'll have a look at the script when I get home!

Chinwagon
05-15-2008, 01:42 AM
That's great Paul, I was thinking about starting something like this but as you know, time is the enemy.
The first suggestion I would have is being able to use a spline as a custom mesh as most riggers/animators tend to like the look of splines as animation controls.
Nice one.
:)

PEN
05-15-2008, 01:54 AM
Well i'm using a scripted helper. You can only add mesh objects but like a point helper it doesn't draw the faces in shaded view. So you can create a circle, colapse to a mesh and then add it. This is how I created the circle option. I will set it up so that if a spline is selected it will convert it then add it. This was just really a test to see if it is was a good idea. Only thing that I see that I can't do anything about at this stage is the point helper parameters of the deletegate are still visible in the dope sheet. Not sure what to do about that as they don't do anything at this point.

Chinwagon
05-15-2008, 02:16 AM
It seems that it'll only work properly on closed shapes, but that's more of a problem of max's conversion of shapes to mesh.
Would it perhaps be better to base the helper off a dummy instead of a point? Dummies don't have any parameters visible in the trackview.

PEN
05-15-2008, 02:22 AM
I didn't try it as I wasn't sure you could add a mesh using a dummy, I will see if it works.

Chinwagon
05-15-2008, 02:24 AM
I just tried it at my end and it works. You still get the dummy track in the trackview, but that's it (besides your options of course).
One other thing I found with it and I know it's still in beta, but loading a file with the helper set as a custom object comes up blank. The helper seems to lose it's connection to the custom object.

PEN
05-15-2008, 02:28 AM
Ya that works. I'm part way done with a first pass on writting it all to an XML. I think that will be a good solution as it will be very flexible. I guess with shapes I will also have to check to see if they are closed.

LoneRobot
05-15-2008, 03:06 PM
Hi Paul,

Good idea. I use your spline controls a lot and sometimes have to swap the contents with another if i change my mind about what a joint is doing. I assumed you've yet to add the position and character options as they dont show anything up for me. (i guess you are going to add a text field entry for the character anyway)

The thing i like about your spline controls objects is that i can get all the controls by using a shape selection filter, and there's no chance of selecting the rig helper objects. I have found this better as people tend to unfreeze objects like rig dummies.

davestewart
05-15-2008, 03:30 PM
Really nice.

I think I'd prefer a dropdown to radio buttons though; it looks and feels a little cumbersome with that many options.

PEN
05-15-2008, 04:16 PM
Well right now I have a dotNet listview, looks nice and clean. Reads all the options from an xml file. I will endevor to allow merging of xml files but for now cut and paste would do as well.

As for the filtering I tend to create even a custom filter for shapes that have a given property on them so we can filter exactly what we want. I will include a filter for this helper class in the package so that you can just use it.

I have changed it up from penControl to penHelper as well. So once I release this please get rig of the old.

PEN
05-15-2008, 05:20 PM
OK try this on for size.

http://paulneale.com/scripts/penHelpers/PEN_Helper.ms

Certainly not complete but good enough to test.

You don't need to save the preset for a custom shape to show remain persistent from Max session to Max session. All the data is stored in the modifier for the current shape.

Saving the presets will save the current shape to a predefined XML file stored at plugins/penProductions/penHelper.xml

Duplicate names are not allowed but it is case insensitive so you can have "test" and "Test" for instance.

Scale and size are not saved with the preset, should they be?

When you add a custom shape it takes on the size of the shape that it is copying. Should I look at normalizing the scale of the copied mesh so that size if more relivant?

When shapes are stored they are stored at there original size and the size and scale values are aplied when the shape is displayed.

Let me know what you think.

PEN
05-15-2008, 05:21 PM
I have also thought about adding offset position and rotation spinners, what do you think?

PEN
05-15-2008, 06:40 PM
Here is a presets file. Needs to go in plugins\\PENProductions\\penHelper.xml or it will not load.

http://paulneale.com/scripts/penHelpers/penHelper.xml

I will create an install script for it as soon as it is all done. Best to load the script in the same location as well as that is where it will reside.

PEN
05-15-2008, 06:46 PM
Major bug, Busted something some where. It doesn't load the correct option!

PEN
05-15-2008, 06:51 PM
Bug is fixed!
http://paulneale.com/scripts/penHelpers/PEN_Helper.ms

PEN
05-15-2008, 07:00 PM
Another little bug. With some of those presets they are splines converted to a mesh and they are flat. What this means is you can't select them from the back side. I will have to rebuild them all with an extude on the spline first.

Eric-Harvey
05-15-2008, 07:16 PM
Very cool little tool here. Perfect for making customizable control objects. Truthfully the stock ones that you have on your website were getting a bit boring. :)

I would definitely like to see the scale be stored and taken into account when making new shapes. Or maybe just scale whetever mesh is inputed down to 1 unit using the bounding box.

PEN
05-15-2008, 08:37 PM
I now have an option for normalizing the mesh when first selected. It work based on the length of the firthest vert, I guess I could use the longest axis of the bounding box as well.

List is now ordered as well and I have several new presets that will ship with it. Any one want to make me a few that will be come defaults? Just send me the XML file that is saved and I will merge them together.

Just drag and dop in your viewport and it will be found under create/helpers/PEN Helpers
Max 9 or higher only as it uses dotNet objects.
Here is the latest: http://paulneale.com/scripts/penHelpers/penHelpers.mzp

Grim Beefer
05-15-2008, 11:05 PM
Looks great! The only thing I've noticed, and this is indeed very minor, is that you can't seem to undo size and scale changes using the Max undo command.

Great job, though, this will really be useful.

PEN
05-16-2008, 01:25 AM
I'll add that in.

marktsang
05-16-2008, 10:53 AM
hi pual,
i did something like this a while ago for a project and i noticed that there is huge framerate drops when using relativly small amounts of extended scripted helpers - in the end i stoped using scirpted helpers, and swithced back to the plain old vanilla helpers :( which dont have this problem

cheers,
mark

davestewart
05-16-2008, 12:38 PM
Yay, useful tools are always such a pleasure to use :)

A few things I noticed:



The list loses its selection when refocused, so it's not immediately apparent when you reselect the object what the last selection was
The list starts with a horizontal scroll bar taking up real estate
Preset names are not reloaded when the scene is, so would be very easy to lose a custom mesh by accidentally clicking another option
The "position" mesh feels very big compared to the other controls!
Having the size option start on 10 feels more intuitive than the tiny 1
Some things that might be nice:

"Export to mesh" option for editing the meshes (Perhaps "Manage" could be "Mesh", with Import, Export, Save and Delete)
A "reset" and "lock axis" option for the Scale parameters
*Maybe* save the scale per-mesh option
I must say, I still don't think the list adds anything, apart from feeling a bit showey-offy (LOOK at all my options! Aren't I a clever little tool :) ).

I agree it's nice to see the options all at once, but once you've set it, you're really only concerned about that one option.

Nice tool though, one I've wanted for a long time.

Dave

PEN
05-16-2008, 01:41 PM
hi pual,
i did something like this a while ago for a project and i noticed that there is huge framerate drops when using relativly small amounts of extended scripted helpers - in the end i stoped using scirpted helpers, and swithced back to the plain old vanilla helpers :( which dont have this problem

cheers,
mark

I wondered about this but in simple tests I didn't see a drop. Also I have added the feature to have it not draw anything at all. This is even better then the current helpers as they can still be selected on screen when all the diplay options have been turned off. This one can't. I put a thousand of them on sceen and didn't see a problem and that was with the most complex mesh. Took a bit to load how ever so simple meshes are better. I notice that the build mesh command is run a lot an I have also noticed that point helpers in them selves are slow, I always turn off the display properties on them when I'm done. CAn you do a test on this for me?

PEN
05-16-2008, 01:58 PM
Yay, useful tools are always such a pleasure to use :)

A few things I noticed:




The list loses its selection when refocused, so it's not immediately apparent when you reselect the object what the last selection was
The list starts with a horizontal scroll bar taking up real estate
Preset names are not reloaded when the scene is, so would be very easy to lose a custom mesh by accidentally clicking another option
The "position" mesh feels very big compared to the other controls!
Having the size option start on 10 feels more intuitive than the tiny 1
Some things that might be nice:

"Export to mesh" option for editing the meshes (Perhaps "Manage" could be "Mesh", with Import, Export, Save and Delete)
A "reset" and "lock axis" option for the Scale parameters
*Maybe* save the scale per-mesh option
I must say, I still don't think the list adds anything, apart from feeling a bit showey-offy (LOOK at all my options! Aren't I a clever little tool :) ).

I agree it's nice to see the options all at once, but once you've set it, you're really only concerned about that one option.

Nice tool though, one I've wanted for a long time.

Dave



I'm working on the list selction when the UI is opened.



I don't think there is anything that I can do with the horizontal bar as it could be needed if the names get long.


What do you mean the preset names are not reloaded? This should happen automaticaly when the rollout opens.


I think that I have already rebuilt the position object. That was added before I had the normalize option in there.


Default size is 10 as I felt the same way.


There is now an extract mesh option so you can get the mesh back out. A bit of a mess since in some cases you don't want certain edges to be visible so it can look odd. I was able to clean up the mesh to the bare nessesities and then delete the old and readd it.


I have also added an offset position and rotation for the mesh that makes it easy to get the mesh in the location you want or to do things like mirror a foot control as I allow the scale to go into negative numbers.


So for the list you are thinking just a drop down list. Your right it is a bit showey but that kinda makes it fun. I'm going to add a lock UI function, might not have a UI item to go with it but instead just an option that you can get access to via script. This would hide the whole rollout so changes can't be made to it. Also I wanted an option to stop the display from being turned off via script so it is easy to hide all helpers that are just part of a rig and not a direct control object.


What do you think?

marktsang
05-16-2008, 02:08 PM
hey paul,
ill have a look at it tonight to see if i can get it slow... maybe i had a mistake in my code :(

cheers,
mark

PEN
05-16-2008, 02:15 PM
Just did another speed test. Helpers in general are slow. with 1000 point helpers I get a frame rate of about 9fps, 1000 PEN Helpers 9fps and 1000 spline sphere control objects I get about 14fps.

So this helper object is the same as others but half the speed of using splines.

Edit: As an update to this 1000 boxes was about 50fps

heyitsdave
05-16-2008, 06:37 PM
Hey Paul,

This is a great utility... thank you for sharing it. The default point helper has a "Draw on Top" attribute. Any chance that can be incorporated into your script?

Cheers,

Dave

davestewart
05-16-2008, 07:36 PM
Hey Paul,

> What do you mean the preset names are not reloaded? This should happen automaticaly when the rollout opens.

I made myself a custom mesh, names it "Cylinder" then saved the scene and reloaded. When I checked the the list, "Cylinder" was gone. So if I accidentally clicked the list and changed my helper to "hand" or something, there'd be no way to get "cylinder" back (save for adding it as a new mesh again).

Not a big thing, but significant I think. Your other changes sound good too.

Good luck with the rest of the development!

Dave

JHN
05-17-2008, 02:38 PM
Dave, do you use Vista? Maybe Vista UAC doesn't allow the the script to alter the xml file, it writes to the xml just fine here... (XP)

-Johan

davestewart
05-17-2008, 03:57 PM
Hey Johan,
Nope, on XP on this machine. I think maybe Paul updated the script between then and now?
Dave

PEN
05-18-2008, 01:44 PM
I will have another update soon so can you try again then Dave?

davestewart
05-18-2008, 02:11 PM
Sure thing :)

PEN
05-20-2008, 08:04 PM
Ok got a few minuets to do a bit more today. I have added image buttons and more presets. The only thing that I really have left is the list doesn't display the correct selection currently. Also I need to work out an issue with the undo and right click letting go of the spinners.

http://paulneale.com/scripts/penHelpers/penHelpers.mzp

Additions are you can now rotate and move the mesh with spinners. I found this a much more predictable way to deal with it as I calc the scale first, then the position, then the rotation. It just feels more like what you would want.

There is now a Display button that will disable the UI and remove the display mesh. Great for using it more like a Maya group that has no display property.

I added a Lock UI option as well. You can now lock it and the UI disapears so it has to be unlocked to be changed. If your lock the UI you can't change the display even with script.

Some script access that you might be interested in.

$.displayGeo: Boolean value
$.lock: Boolean value
$.setPresetByName string --Sets the preset by it's name. Currently this is case dependent.


http://paulneale.com/scripts/penHelpers/penHelperUI.jpg
(http://paulneale.com/scripts/penHelpers/penHelperUI.jpg)

JHaywood
05-21-2008, 08:29 PM
Very nice. I just gave it a really quick try and didn't find any problems. I now have a cute little Master Chief helper. :)

A couple minor things that occured to me:
1) The hand and foot icons face different directions. It would make more sense if they faced the same way.
2) I would force the wirecolor to be green, just like standard helpers. That visually reinforces the fact that they're helper objects.

kevnich00
05-21-2008, 08:43 PM
I'm having a little trouble, probably a user error. When I click on any of the preset helpers I get an error:
--Unknown property:"pos" in undefined
and it highlights line 187 in the script.

Where am I going wrong? TIA

davestewart
05-21-2008, 10:27 PM
The hand and foot icons face different directions. It would make more sense if they faced the same way.

I thought this as well, but after thinking about it fgured most people will model a character with the feel facing towards them, and probably the hand with it facing away from them.

Mayeb the hand should be rotated 90 degrees in Z?

davestewart
05-21-2008, 10:28 PM
Me too, when I click on the Display list, before clicking in the viewport to create the plugin:

rPos=((transMatrix pos) * ((eulerAngles rotX rotY rotZ) as matrix3) * inverse (transMatrix (refs.dependents this)[1].pos)).pos + (refs.dependents this)[1].pos

PEN
05-22-2008, 12:51 AM
Ya the last one that I posted had that bug and I hadn't noticed. It is now corrected but I have one more small one to deal with. I will rotate the hand in the same direction of the foot and I like the idea of green or something similar. Then again.. should I save the wire color with the preset in the XML? I was wondering if I should save all the settings with the presets as you could completely customize what you want as a default then for each. What do you think?

PEN
05-22-2008, 01:02 AM
I have a bit of an interesting bug with it. If I try to set and item in the listView to selected it crashes Max.

lv.items.item[i].selected=true

That line is taking it out, any suggestions?

This is the whole function...

fn updateLVselection lv=
(
-- print (refs.dependents this)[1]
if isValidNode (refs.dependents this)[1] then
(
for i = 0 to lv.items.count-1 do
(
if lv.items.item[i].text==displayTypeName then
(
lv.items.item[i].selected=true
)
)
)
)

MarcoBrunetta
05-22-2008, 01:10 AM
Not sure how the listview works, but with a .net treeview I generally use the treeview.selectedNode property to set the current selection (something like treeview.selectedNode = treeview.nodes.Item[1] or so).
Maybe there is something similar for a listview?

PEN
05-22-2008, 01:21 AM
I have done that in treeview but I don't see it in listView. I'll keep trying as it worked when I was at another shop today but at my office it doesn't.

PEN
05-22-2008, 01:38 AM
Problem deviated, not setting the selection any more but setting the colors. I think that what is happening is a major loop. I'm using the event that is called when the selection changes and it is causing a loop to happen.

PEN
05-22-2008, 03:06 AM
DONE!....I think. let me know if you run into any isses with it at all. Undos are still a problem and I will look into that another day as it isn't a big deal.

Links to the down load and help page on my site.
http://www.paulneale.com

http://paulneale.com/scripts/penHelpers/penHelperBanner.jpg

Chinwagon
05-22-2008, 03:58 AM
Sorry Paul, but I get a crash whenever I try to click a point in the viewport to create the helper. I'm using max 2008.

PEN
05-22-2008, 01:56 PM
That is the same crash that I was getting last night and thought that I had corrected:S

Try now, I think all that it was is the script didnt over write what was on the FTP. Let me know if you get that error or any other.

Chinwagon
05-22-2008, 03:29 PM
Yep, that fixed it.
One cheeky little thing to point out though... the preset "Planer Rotate" should be spelled "Planar Rotate".
;)

PEN
05-22-2008, 05:18 PM
Oops:S Ah well, math I can do, spelling well that is just another thing all together.

kevnich00
05-22-2008, 05:24 PM
I'm still getting an error. When I click on any helper in the list a dialog box appears with:

"--Unknown property: "transform" in undefined"

and line 211 is highlighted.
Ideas??? I'm using 2008.

PEN
05-22-2008, 05:36 PM
And you are sure that you down loaded the most recent update?

I now have about 20 people using it that don't get an error. Can you please confirm this by down loading again and reinstall.

kevnich00
05-22-2008, 05:37 PM
Got it sorted...user error. Did not know to click in the viewport first, then select the style.

Thanks for this! As usual, along with your DVD's, you just keep making my days easier to deal with in Max.

PEN
05-22-2008, 05:39 PM
OH so there is an error if you select in the list first then, OK hadn't tried that. Will correct it asap.

PEN
05-26-2008, 08:02 PM
Version 1.10 is up. New features, faster more presets that ship with it.

http://www.paulneale.com/scripts/penHelpers/penHelper.htm

heyitsdave
08-08-2008, 09:30 PM
Hey Paul,

This is a great utility; thank you very much for sharing it. I tried it out briefly when you first posted it and only today started using it as a part of my work flow.

I'm finding that I get the error " -- Unknown property:"items" in dotNetControl:lv:(null) " when I try to clone a PEN Helper object. The script file PEN_Helper.ms opens with the following line highlighted:
for i = 0 to lv.items.count-1 do
Any ideas? Does that happen for anyone else or is it just me? Should I avoid cloning the helpers and just make new ones when I need them?

Thanks again.

- Dave

PEN
08-08-2008, 09:44 PM
I'll have to look into that. I'm not actualy using it my self as I wrote geometry class ones instead. I will see If I can find the issue on monday and get it corrected asap for you. Thanks for pointing it out.

heyitsdave
08-08-2008, 09:52 PM
Awesome; thank you Paul.

- Dave

heyitsdave
08-11-2008, 04:49 PM
I'm also experiencing an issue when I attempt to change the size of a PEN Helper via MaxScript. The "Lock UI" option is not enabled.

$.size = 0.45

When running the above line, no error is reported, the value of the size spinner for the selected PEN Helper reflects the change immediately, but the object in the viewport does not update. If I use the "Display" list in the helper rollout to change the type of object used as the display mesh, the viewport then updates reflecting the size change. FYI, I am using the supplied "Rotate Control" display object - no custom meshes being used yet. It seems like a viewport refresh problem; is this a known issue or it is it just me?

Still a great utility and I am happy to be using it. Thank you again Paul.

- Dave

PEN
08-11-2008, 10:31 PM
I'm aware of this one Dave. I'm not using a get handler only a set handler as it was easier to impliment. I will see if I can add this for the helper class object as well as I'm now doing it in the geometry class ones.

CGTalk Moderation
08-11-2008, 10:31 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.