Generate Primitives At Current Cam View

Is there any sort of MEL script or plugin that will allow for primitives in Maya to be generated at the current camera view (persp) instead of at the world origin? I'm tired of having to constantly navigate there to move objects in large scenes, and I haven't been able to find any such setting or script. Thanks for helping a newb!

this probably wouldn't be hard to make but as of Maya 8 there's a new feature (interactive creation) that allows you to interactively create primitives whereever you are looking.

I always create the object and then hold v to snap it to a surface in my view. How would the script know where to be created elsewise?

Though there is a way to create the object in the Center Of Interest of the camera. I did that in our Level Tools.:

  • move your object to the camera location
  • spin it like the camera
  • move it along Z-axis the amount given at cameras "Center Of Interest"-attribute
  • unspin the object

voila! this way you create objects in the middle of your view. not hard to rescript.

Another way would be to shot a ray along the camera view. But I know nothing that could do the job without looping through all objects.
rayIntersect of course may do the job. But as I said: its not able to just "shoot". You have to give it an object to shoot at. This would mean you'd have to loop through all objects in the scene and query if its

  • in the ray through the cam
  • the very first in this ray
  • For our leveldesigners as well I did a dropObjet-script that does the following: It checks for special named objects and browses only those. I don't know what sized scenes you are dealing with .. but of course rayChecking ~1000objects is slow.

    AHH! Another nice way: do a selection and move the new object to the position of your selection! Let it be a vertex selection or transform...

    eek: pardon me but.. "interactive creation" iz teh cr4p!!