Notifications
Clear all

[Closed] comparing two arrays

Hey guys,

How would i go about comparing two arrays in order to then do a specific task…like exporting the verts? I have the code that i need to get the geometry out in the format i need…its just that i want to be able to do it all in one go…all the different objects in the scene at once. How i have it setup now, i have to go in and do each part manually by adjusting a spinner value.


   d = (head, arm, foot)
   e = (1000, 2000, 3000)
   

I want to be able to collect the scene objects in the [color=DarkOrchid]array d[/color] and then have some way of adding the values i specify the array e to the vert nulbers of objects collected in d automatically.

So head would always have a value of 1000 added to the vert number, arm 2000 and foot 3000 and so on.
This is a bit of the code that i’m using now which takes a spinner value and adds it to the vert number.


   local ddd= my_spin.value
  for v = 1 to num_verts do
  (
  vert = getVert tmesh v
  format "%,%
" (v+ddd) vert to:out_file   --spinner value is added to the # amount that you want for the variable "v".
  )
  format "
" to:out_file
   

So in the code above, instead of setting the spinner value ddd i would get those numbers from the array e. Just not sure how i can always make sure that the specific scene object gets the right number. The value has to be assigned by the name of the object in the scene. I hope this is clear…trying to muddle my way through learning maxscript! Any and all help is greatly appreciated…and if it needs clarification let me know. Thanks!

5 Replies

Nice Rivendale.

need some letter here too…

Nice one! thanks everybody.

Cheers

Dan

take a look at MXS HELP
[color=white]Structure Definition[/color]

it’s the way how to do these things

Thanks Denis…looking into it now!