ScriptSpot

Forum topic · General Scripting

beginner question

By Smallface · 2010-09-21

Description

Sorry Im an absolute beginner at this but I want to create a rollout script that, at the press of a button can read the selected object/model(s) name(s) and position(s) in scene and write it to the maxscript listener

ie..
Myobject, 5.00, 5.00, 5.00

I know how to create a rollout and a button but thats all atm.
can anyone help me out please? as I trying to get my head around this but need some relevant-to-me examples to start from

thanks

Comments (2)

Anubis · 2010-09-21

for i in selection do format "%, %, %, %\n" i.name i.pos[1] i.pos[2] i.pos[3]

.. on foo pressed do (

Graph · 2010-09-21


..
on foo pressed do
(
  local sel = selection as array
  local obj = sel[1]

  if isValidNode obj do format "Obj:% Pos:% KindOf:%\n" obj.name obj.pos (classOf obj.baseObject)
)
..

the maxScript help is quite helpful and well written, dig into it