PDA

View Full Version : Bone Tools - Create End, Script?!


blake_spector
01-18-2011, 07:16 PM
Hi there,

is there any script that performs what clicking the 'Create End' in the Bone Tools does?

I create a bone using BoneSys.createBone between two points, and I want that bone to have an End-Nub...

Greets, Jan

PiXeL_MoNKeY
01-18-2011, 07:33 PM
From the Macro_BoneAdjustmentsTools.mcr:on CreateEnd_btn pressed do
(
undo "Create End" on
(
if (selection.count == 1) do
(
with Animate Off --with Animate Off bracket open
(
local parentBone = selection[1]
local parentTrans = parentBone.transform
local parentPos = parentTrans.translation
local newbone

with redraw off (
newBone=BoneSys.createBone parentPos (parentPos+6) parentBone.dir
newBone.transform = parentTrans
in coordSys Local move newBone [parentBone.length,0,0]

newBone.parent = parentBone
putChildIntoAssembly newBone

newBone.width = parentBone.width
newBone.height = parentBone.height
newBone.taper = 90
newBone.length = (parentBone.width+parentBone.height)/2
newBone.wirecolor = parentBone.wirecolor

select newBone
)

redrawViews()

) -- with Animate Off bracket close
)
)
)

-Eric

blake_spector
01-18-2011, 08:02 PM
Awesome, thank you very much!!

CGTalk Moderation
01-18-2011, 08:02 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.