Poly Object to Script

Hi

Has anyone got a script that will take a custon polygon mesh and output the code to build it in a max script. ie save out all the point and polygon data?
I am trying to make my own custom helper objects.

Thanks

Gram

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gramx's picture

Custom Poly Helper

I have written a script to turn your pyramid into a custom helper(code below). Unless I am missing something it appears that you can only create wireframe helpers! If you run the script below it creates a wireframe helper pyramid. Is there anyway to display a shaded polygon helper?

-------------------------------- start
plugin Helper rt_Helper
name:"rt Helper"
classID:#(0x357d24c1, 0x52e1d978)
category:"Standard"
extends:dummy
(
local meshObj, theMesh

on getDisplayMesh do
(
if meshObj == undefined then
(
meshObj = mesh vertices:#([0,0,51.5526], [-39.0721,-40.7057,0], [39.0721,-40.7057,0], [39.0721,40.7057,0], [-39.0721,40.7057,0], [0,0,0]) faces:#([1,2,3], [1,3,4], [1,4,5], [1,5,2], [2,6,3], [3,6,4], [4,6,5], [5,6,2])

theMesh = copy meshObj.mesh

delete meshObj
)
theMesh
)

tool create
(
on mousePoint click do
(
nodeTM.translation = gridPoint;#stop
)
)
)
----------------------------------- end

gramx's picture

Pyramids

Cool, It makes a Pyramid!

I will have a go at making a scripted plugin to build a new helper object now.

Great stuff!

Thanks

Gram

gramx's picture

That would be very cool, I

That would be very cool, I have seen a few posts on the forum with people wanting to have a similar script!

Thanks

gram

Garp's picture

I have to write a 'make

I have to write a 'make primitive' script.
If you can wait a few days...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.