View Full Version : create object and parent to selected?
05-07-2006, 01:04 AM
I'm messing around with automating some things with VBscript and I'm having a bit of trouble. What I want to do is create some objects and then parent them to my current selection. The problem is that if you create some objects the currently selected object becomes unselected. I've been looking through the SDK, but I'm not really sure what I should be looking for.
If someone could point me in the correct direction, I would really appreciate it.
05-07-2006, 08:32 AM
If someone came to me with the problem, I would store my first selection and get it's name when the script initially runs. Then it wouldn't matter if the new objects deselects the original object as the script now understands that your intention is to parent all the newly created object under what you initially selected.
I'm not sure if that's the effect you're going for.
05-07-2006, 09:00 AM
simple way to do it would be to make a call to addGeometry()
var oSel = Application.Selection(0)
oSel.AddGeometry("Sphere", "MeshSurface", "My_Happy_Sphere")
05-07-2006, 09:43 AM
Thanks for the replies!
I managed to get around the problem using oSel, but after seeing your code, I don't think I am using it correctly (but it does work).
I will do some more experimenting using the example code tomorrow.
I just spend all day creating a simple forearm twist setup that will set the rotation expressions and use the selected bone name to name the twist cubes. It may not be beautiful or difficult for one of you, but I never expected I could get this far.
I'm actually very excited about this and can't wait to expand on this. :bounce: I could have never done this in lightwave!
Thanks again 5quid and ntmonkey!
10-10-2006, 01:23 PM
This thread hasn't been touched in awhile. Hi Sam, I'm a convert from lightwave myself, and rigging is just fun. XSI is a killer app.
I know it's been awhile but, how did u fare with ur forearm twist?? I'm trying to recreate something like the 3dquakers whole arm twist, but i'm still wrapping around all the contraint options and how to use them. I hope you can share with us how you managed your forearm twist. That'd be awesome of you.
10-10-2006, 01:23 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.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.