Jump to content

mantra scripting


Jason

Recommended Posts

Did you know that you can script mantra?

Did you know that its a command structure thats a subset of hscript?

You can make for/next loops and define strange and interesting things inside of the ifd and mantra will render them.

# Define some geometry named "geo".  It is smooth shaded.
    ray_detail -s geo $HH/geo/defcam.bgeo

    # Define the camera and output image
    ray_picture ip# Set the output image name
    ray_resolution 256 256# Set the output resolution
    ray_zoom 1# Set the field of view
    ray_clip .01 100# Set near/far clipping planes

    # Now, instance the geometry 5 times.  We can use the standard
    # hscript expression evaluation and variable expansion to position
    # the objects.
    for i = 0 to 4
      ray_object object$i geo# Define an instance

      # Transform the instance
      set x = `.2 * ($i - 2)`
      ray_transform 1 0 0 0  0 1 0 0  0 0 1 0  $x $x 2.5 1

      # Apply a surface shader to the instance
      ray_shader constant clr `rand($i)` `rand($i+.1)` `rand($i+.2)`
    end

    # Tell mantra to render the scene
ray_raytrace
ray_quit

Do you want to know more?? B)

Link to comment
Share on other sites

  • 4 months later...
Did you know that you can script mantra?Do you want to know more??  B)

LOL! :D

Nice one Jason!! wooohooo!!

Should I even ask where you got that from? :P --- doesn't matter, it has now been Wikified, Baby!

If it weren't for the fact that i'm in a mad push to finish a job, I'd give it a whirl right now!

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...