Query result of PencilCurveTool

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
Old 03 March 2011   #1
Query result of PencilCurveTool

Hey Guys,

For something I'm creating I need the results of the PencilCurveTool.
I initialize the tool for the user, let him draw something. When the curve is drawn I've a scriptJob do something with that curve. But I need the name of the curve that's being a created. But I can't get the result in the script of the command. This is giving me a headache.

Or is there any way to initialize my own version of the PencilCurveTool and where could I find the source code corresponding to this Run Time Command? (PencilCurveTool is a Run Time Command)

Hope someone can sort this out for me, because I don't have a clue on how to progress with this?

Thanks in advance.
Old 03 March 2011   #2
Hey Roy, you don't need the tool command to give you the name of the created curve, because once the tool has completed, the only thing selected will be the new curve. You could just initialise a scriptJob on "SelectionChanged" when the user enters your pencil-based tool, when they complete the curve selection changes, fires the scriptJob which then simply queries what is selected with `ls -sl` - which gives you your curve. You can always then kill the scriptJob (or make it run once only in the first place).

oh, btw, you can also start the pencil tool with this:
curveSketchToolScript 4;
Old 03 March 2011   #3
I couldn't find the command you were talking about, but echo all commands reveals:

curveEPToolScript 4;
// curveContextEP // 
curve -d 1 -p -3.048683 0 5.879469 -p -2.715299 0 1.915815 -p 2.687064 0 3.548077 -k 0 -k 1 -k 2 ;
// curve1 // 

So my guess is that that the curve command actually create the curve, and escape tool returns it. There's also some script involved you should check out.
Old 03 March 2011   #4
Hey Nathan,

That's precisely what I did. I set up a scriptJob running once when the selectionChanged. But if the user mid-process decided to not draw, but switch to another tool the actual curve will not be created. There's just no way to check if the user really finished drawing with the pencilCurveTool, right?
Than my script would run on whatever the user is going to select next.

Unless there's a way to kill my scriptJob when the user switches the tool? (another scriptJob?)

And yes. Running it with curveSketchToolScript 4; is a better choice. Than I'm sure the user will not be getting the tool options.


Last edited by BigRoyNL : 03 March 2011 at 10:26 AM.
Old 03 March 2011   #5
well there's the ToolChanged event, so you could make it kill everything once the user drops the pencilTool...

Old 03 March 2011   #6
another possible alternative would be to ditch the pencil tool entirely and create a new tool of your own using draggerContext. This would give you back a series of points in 3d space as the user dragged which you could then use to construct a curve of your own (if that even is actually your ultimate aim..?)

Old 03 March 2011   #7
If I would do it with the ToolChange scriptJob I need it to kill the selectionChanged scriptjob and vice versa. If the selection changed, it would have to kill the ToolChange scriptjob I guess.

And that draggerContext seems interesting, I'll be digging into that.

I need the created curve for placement of a couple of objects.

What I did with my script is first create a nurbsPlane that is perpendicular to the camera. Position it to a certain depth (based of another objects position), make it live. Draw on that. Use the curve for placement of objects. Maybe you know a better way?

Nathan, do you by any chance know how to add function to the artisan tool (Sculpt Tool.) I want to 'move' the vertices with this tool instead of really sculpting it, but I need all of the functionalities this tool provides besides the sculpt mode. Hope you know, have been trying to find out for quite some time. AAaa!

Old 03 March 2011   #8
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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
Society of Digital Artists

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

All times are GMT. The time now is 07:45 AM.

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