Simple script example for making cones?


#1

Hi all,

I am not to scripting (very new) and was wondering if anyone could help me out by writing a script (mel or python) for, wherever there is a locator in the scene, generating a cone at that location? - It is for match move proofing.

Thanks all! :thumbsup:


#2

Or a simple script for finding the locations of the locators?

I just need to create cones on locators in a scene so I can see them more easily

Thanks again :keenly:


#3

Hi ! Does this work for you ?


 string $transforms[] = `ls -type "transform"`;
 string $locators[] = `filterExpand -selectionMask 22 $transforms`;
 for ($locator in $locators)
 	{
 		vector $pos = `xform -query -translation -worldSpace $locator`;
 		polyCone -name ("cone_" + $locator);
 		move -r ($pos.x) ($pos.y) ($pos.z) ("cone_" + $locator);
 	}