CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-03-2013, 12:18 AM   #1
niculaegeorge
New Member
 
niculaegeorge's Avatar
portfolio
George Razvan Niculae
computers technician
Campina, Romania
 
Join Date: Feb 2013
Posts: 10
Wink Assign a controller to ring array number of objects

Simply put I want to dynamically control the number of objects in my ring array using a spinner attached to a dummy object. By selecting one of the boxes in the array the parameters of the ring array can be modified under the ďmotionĒ tab . Here we can find the spinner ďnumberĒ which directly controls the number of boxes in the array. I want to assign a controller to this spinner, or wire this parameter to other objects in my scene. I can already control the amplitude and radius of the array remotely using an assigned controller - float expression that depends on other parameters in my scene. The problem is that there is a flaw in the ring array system . You canít assign a controller to the number of objects in your ring array which is exactly what I want and I donít understand why It canít do that since itís doable for the rest of the ring array parameters (radius, cycles, amplitude, phase). Therefore I am forced to learn maxscripting just for this problem . There are a huge number of scripts that can create arrays in a multitude of ways that are so sophisticated and unnecessary complicated for my particular simple task. However the problem is that all the maxscripts Iíve tried regarding the creation of arrays of objects are inside a separate floating window. But I donít want control from there! I want the number of objects in my array not to be controlled by me turning a spinner but by other changing parameters of other objects in my scene. Therefore I know I either have to use wire parameters or assign a float expression controller to the number of object in my array. Even so, all the array scripts Iíve tried donít list their parameters in the wire parameters dialog window nor in the track view.

So Iím thinking that I need to assign a custom parameter to a dummy which will control the number of objects in a custom ring array. Something like this:
Code:
Dummy pos:[0,0,0] isSelected:on $.name = "myarray" custom_attributes = attributes attrib ( parameters main rollout:params ( Ele type:#integer default:7 ) rollout params "Custom Attributes" ( spinner ele "Elements" type:#integer ) on ele changed val do ( for var = 1 to $myarray.ele do ( Sphere radius:4.143 smooth:on segs:9 chop:0 slice:off sliceFrom:0 sliceTo:0 mapcoords:on recenter:on pos:[23*cos((var*360)/$myarray.ele),23*sin((var*360)/$myarray.ele),0] isSelected:off ) ) ) custAttributes.add $ custom_attributes
Itís a simple task, Iím sure of that, but itís hard for me since Iím a complete newbie at maxscripting. Iím not new to scripting, but regarding maxscript, this is my first one.

The problem is that it doesnít work. I donít know how this is supposed to work, it should do an update of the number of elements, I donít know, or delete the old array, and recreate a new one each time the dummy parameter changes, I donít know. All I want to do is to assign a control that controls the number of objects in a simple ring array. Thatís all.

I even approached this problem from another perspective by creating a modifier that will be applied to an object and convert it or another to a ring array, something like this:
Code:
plugin modifier myMod name: "geo" classID:#(685325,452281) ( parameters main rollout:params ( ele type:#integer default: 3 --animatable:true ui:ele on ele set val do ( for var = 1 to val do ( Sphere radius:2.13 smooth:on segs:9 chop:0 slice:off sliceFrom:0 sliceTo:0 mapcoords:on recenter:on pos:[23*cos((var*360)/val),23*sin((var*360)/val),0] isSelected:off ) ) ) rollout params "Parameters" ( spinner ele "Elements: " ) )
This script not just that itís not working, but it crashed the entire 3ds max environment when I tried to apply the ďgeoĒ modifier to a box . I already hear the laughs of experienced scripters. I have a feeling that the first script was a more correct approach to my problem than the last. Please, can someone help me with this simple task? I would greatly appreciate itÖ

Iím using Autodesk 3dsMax 2013 x64 version 15 product update 6 on a Windows 7 x64 aspire v3-571G laptop 8 GB DDR3 1333 MHz Memory, Nvidia GeForce GT 630M video card with 2GB dedicated VRAM.
 
Old 02-03-2013, 12:18 AM   #2
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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 08:38 PM.


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