CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 11-26-2013, 08:03 PM   #16
kredka
Frequenter
portfolio
PIOTR LANCUCKI
Gdansk, Poland
 
Join Date: Aug 2009
Posts: 193
for me as novice this code was most transparent

select geometry
mycontrollerlist=#(Position_XYZ,audioposition)

for o in selection do
(
local controller = classof o.position.controller

for item in mycontrollerlist do
(
if item == controller then
(
messagebox "I found my controllers"
exit
)
)

I check it on geometry with Position_XYZ controllers
But don't work.
 
Old 11-26-2013, 09:24 PM   #17
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,511
Send a message via ICQ to denisT
Quote:
Originally Posted by kredka
Without your help I would't be able to do much

Code:
( -- make a test scene delete objects which = #(Box, Sphere, Cone, Teapot) for k=1 to 100 do which[random 1 4] name:(formattedprint k format:"03d") -- do a check for n in objects do ( i = finditem which (classof n) case i of ( 1: format "%:\t-> Box\n" n.name 2: format "%:\t-> Sphere\n" n.name 3: format "%:\t-> Cone\n" n.name default: format "%:\t-> X3\n" n.name ) ) )
 
Old 12-01-2013, 03:53 PM   #18
kredka
Frequenter
portfolio
PIOTR LANCUCKI
Gdansk, Poland
 
Join Date: Aug 2009
Posts: 193
simplest list compare case

ok, let say I have such a case: I have numbers in list and I what popup if I found on of object from my list. Code is:

objlist=#(2,4,5)
for i =1 to 10 do
(
print i
if i==objlist then messagebox "sss" --<--- here is my action but don't work
)

and second case:

I want loop in exception(exclude) of my objlist=#(2,4,5)

so it should be:
for i=(from 1 with exception of objlist)? to 10

I know it's simple but I know I'm very close with first one however something is missing. Second case may be totally wrong.
 
Old 12-01-2013, 04:05 PM   #19
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
Quote:
Originally Posted by kredka
ok, let say I have such a case: I have numbers in list and I what popup if I found on of object from my list. Code is:

objlist=#(2,4,5)
for i =1 to 10 do
(
print i
if i==objlist then messagebox "sss" --<--- here is my action but don't work
)

and second case:

I want loop in exception(exclude) of my objlist=#(2,4,5)

so it should be:
for i=(from 1 with exception of objlist)? to 10

I know it's simple but I know I'm very close with first one however something is missing. Second case may be totally wrong.

First case
Code:
for i = 1 to 10 where findItem objlist i != 0 do print i

And second case (opposite)
Code:
for i = 1 to 10 where findItem objlist i == 0 do print i

BTW read about "Array Values" topic in mxs help
__________________
Looking in the right side. [bgaTools]
 
Old 12-01-2013, 04:05 PM   #20
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:07 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.