Help?
invoke skeleton-mode "pick" session w/ script?
-
bergj
- Posts: 36
- Joined: 06 May 2012, 03:58
invoke skeleton-mode "pick" session w/ script?
Like the topic says, Im interested in entering certain modes like skeleton and curve with a command. I can of course set bones and their effectors with a script very easily, but thats not what Im going for and I cant get into the pick mode for creating bones or curves. Im working in python but jscript is ok too.
Help?

Help?
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Re: invoke skeleton-mode "pick" session w/ script?
Check the SDK docs for the PickElement() command. There you can pass an argument to have it only pick bones. You'll have to handle what happens after the pick session though.
You can't go into a "curve" mode unless you activate a certain tool. You'd probably have to create a custom tool for a specific task that isn't handled by the native tools using C++.
You can't go into a "curve" mode unless you activate a certain tool. You'd probably have to create a custom tool for a specific task that isn't handled by the native tools using C++.
-
bergj
- Posts: 36
- Joined: 06 May 2012, 03:58
Re: invoke skeleton-mode "pick" session w/ script?
Thanks for the help, Eric.EricTRocks wrote:Check the SDK docs for the PickElement() command. There you can pass an argument to have it only pick bones. You'll have to handle what happens after the pick session though.
You can't go into a "curve" mode unless you activate a certain tool. You'd probably have to create a custom tool for a specific task that isn't handled by the native tools using C++.
I think I may have worded the problem incorrectly. What Im trying to say is that there seem to be some undocumented commands that you can run from the menus and nothing will show up in the script ed. You can guess(??) at their command names and if you get it right they will work for you.
For example, I wanted to map the command to draw a 2d skeleton chain to a hotkey but when i called it it didnt echo. I found out that to call it and similar I should do
xsi = Application
xsi.Commands("2D Chain Tool").Execute()
now, Im wondering how to do the same to create a curve like this.
Draw Cubic by CVs
Draw Cubic by Bezier-Knot Points
Draw Cubic by Knot Points
Draw Linear
I've tried many variations of this but it doesnt work.
xsi.Commands("Draw Cubic by CVs Tool").Execute()
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Re: invoke skeleton-mode "pick" session w/ script?
I see now. There are many commands that are "hidden" as such. I think I would take the same steps you have.
Then I would try logging all commands and sifting through to see if you can find the one you're after like:
There may be a quicker way to search and find what you need from the xsi.Command collection. Hopefully Stephen Blair sees the thread and can assist as well.
Then I would try logging all commands and sifting through to see if you can find the one you're after like:
Code: Select all
collCommands = xsi.Commands
for eachCommand in collCommands:
log(eachCommand.Name)
-
bergj
- Posts: 36
- Joined: 06 May 2012, 03:58
Re: invoke skeleton-mode "pick" session w/ script?
Thanks. These are the commands.
Draw Cubic by CVs
xsi.Commands("CV NURBS Curve Tool").Execute()
Draw Cubic by Bezier-Knot Points
xsi.Commands("Bezier Curve Tool").Execute()
Draw Linear
xsi.Commands("Linear Curve Tool").Execute()
Draw Cubic by CVs
xsi.Commands("CV NURBS Curve Tool").Execute()
Draw Cubic by Bezier-Knot Points
xsi.Commands("Bezier Curve Tool").Execute()
Draw Linear
xsi.Commands("Linear Curve Tool").Execute()