Notifications
Clear all

[Closed] Camera – Transform constraint to mesh verteces

Hi!

I’ve created a Sphere Object in 3dsmax, and a Camera Object.

I’d like to make the camera position XYZ be the same as SphereVertex N.1 at frame 1, be the same as SphereVertex N.2 at frame 2 and so on.

In this way if for example the Sphere has 32 subdivision I can use 288 vertex to create 288 render image using the same camera and use this image to create an objectVR movie file.

I’ve tried different method to create these image render, and I think that linking a single camera to sphere verteces in different frames is the fastest and most flexible way.
But I don’t know how to do

I thank you very much in advance for any kind of help.

Bye!

3 Replies

Hi Daniele, here is a script to do the job. Just create a Reference Geometry, like a sphere, then select it and run the code. It will create a target camera with target positioned at sphere pivot and from frame 1 to the number of vertexes in the sphere a keyframe with camera positioned in corresponding vertex index position.

(
    if (Selection.count == 1) do
    (
        local theGeo = undefined
        if (superClassOf Selection[1] == GeometryClass) do
            theGeo = snapShot Selection[1]

        if (isValidNode theGeo) do
        (
            local theCam = targetCamera pos:[0,0,0] target:(targetObject pos:[0,0,0])
            theCam.wireColor = Color 87 120 204
            theCam.target.position = theGeo.position

            local gv = meshOp.getVert

            with animate on
                for i = 1 to theGeo.numVerts do
                    at time i
                        theCam.position = gv theGeo i

            delete theGeo
        )
    )
)
  • Enrico

Greate Enrico, it works perfectly.

Thank you very much.

At this point I need to ask you a consequence question of this little workflow:

-The software I’ve found to merge all images (objectVR http://gardengnomesoftware.com/object2vr.php ) accept in input a file name like this
‘img_’+ (row) + ‘_’ + (column) + ‘.jpg’

so the file should be: image_0_0.jpg – image_0_1.jpg – …

If we imagine a sphere with 8 (raw) x 32 (col) verteces, I think the easiest way is to say 3dsmax that from frame 0 to 31 file name is “image_0_#”, from frame 32 to 63 “image_1_#” and so on, where each time # start from 0 and ends to 31.

Maybe this is not the fastest and easiest way, in the meantime I’ve found a useful software (Lupas Rename 2000) which helps me to rename images in a folder similar to the SoulBurnNameManager script, but anyway it’s still quite tedious, ’cause I’ve to repeat a series of operations for each raw; maybe for a grid of 8×32 is not so long, but for a bigger grid and for multiple 3d objects ti will be

So… I’d like your opinion on opportunities on how to solve.

Thanks a lot again.

I’ve found a possible rude solution:

-Created a sphere 16 (raw) x 64 (col)
-Use your script
-Open batch render
-Create 16 batch process, each of them use Camera01, but the first from frame 0 to 63 with image output name “image_0_”, the second processo from frame 64 to 127 with image output name “image_1_”

In this way I’m near to what I’m looking for (just tedious to create 16 batch process, but tolerable )
There’s just one problem, that 3dsmax use this syntax for filenameoutput “image_0_XXXX”, while I need “image_0_X”.
Do you know how can I modify that?

Thank you