Home Technical Talk

Maxscript - Probably a simple fix

Novian
polycounter lvl 12
Offline / Send Message
Novian polycounter lvl 12
Dear Polycount,

Greetings! I am new to the ranks and have a quick question for any Maxscript pros out there.

This is probably a simple fix and I am just missing something.

The Effect:

The effect that I have been charged with creating is a sort of card flipping visual you commonly see at sporting events where each person holding a sign flips it over and the people right next to the first person do so just after, creating a wave effect of cards flipping.

I have a model of the earth created out of quads that will all flip in sequence. The flipped texture will also power the alpha channel thus making the land masses appear from the ocean; traveling coast inward.

The Problem:

The issue is that each land mass is currently one mesh and what I need to do is take each polygon, detach it as an object, center the pivot, and animate the flip.

The Script:

To do so I am writting a script to loop through the polys and detach each one. I've done some debugging and I can see that it counts through all 3157 polys (using the USA land mass as my test) but it never detaches anything. The code is as follows, any help at all would be greatly appreciated.

Cheers~




Code:

rollout MU "Make Unique" width:125 height:200
(
button btnGo "Do it!" pos:[15,100] width:100 height:25

on btnGo pressed do
(
numfaces = $.GetNumFaces()

subobjectLevel = 4

for x = 1 to numfaces do
(

$.EditablePoly.SetSelection #Face #{x}

$.EditablePoly.detachToElement #Face keepOriginal:off
)
)
)

createdialog MU

Replies

Sign In or Register to comment.