Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

 
First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
 
my scripts thread
show user profile  parkerfamily
i'm making this as a single thread for all my help in maxscript, which i'm trying to learn atm, and heres my first script.

x = random 1 360
y = random 1 360
z = random 1 360
rotationobject = eulerangles x y z

rotate $ rotationobject

what should i try next? my main problem is actually thinking of stuff to make maxscript do. i can rotate and move already, but i forgot scale.
read 521 times
8/19/2009 12:59:05 PM (last edit: 8/19/2009 12:59:05 PM)
show user profile  advance-software
If you write one to convert x-refs to 2010 container references you'd save me a job.

Sorry, it's not very exciting & I don't even know if this is possible from maxscript.
read 513 times
8/19/2009 1:08:05 PM (last edit: 8/19/2009 1:11:02 PM)
show user profile  parkerfamily
i don't have 2010.... so i don't think so.

and by all my help i meant help for me learning it, not helping people with it, but if anybody has a simple one for me i would do it...
read 502 times
8/19/2009 1:23:24 PM (last edit: 8/19/2009 1:23:24 PM)
show user profile  parkerfamily
i have the "for obj in $ do
(
script
)"

thing, but how do i make that do it for each object individually, generating all the randoms a new for each one? so i can make them rotated differently.
read 499 times
8/19/2009 1:25:19 PM (last edit: 8/19/2009 1:25:19 PM)
show user profile  s_purs
just go through dubs script tutorial thread. good basics there, thats what ive done. if you find a good tutorial for stuff slightly more advanced after let me know- looked at bobos and stuff but found it a bit boring/too technical at times. i liked the light nature of dubs
read 498 times
8/19/2009 1:26:14 PM (last edit: 8/19/2009 1:26:14 PM)
show user profile  Dub.
s_purs, if there is anything specific you want to do, let me know and I'd do a more advanced tut.

I was thinking about doing one about vectors.

Reminds me, I need to update my tuts.


read 478 times
8/19/2009 5:15:41 PM (last edit: 8/19/2009 5:16:04 PM)
show user profile  Nik Clark
parkerfamily, for your code, something like:

for i = 1 to $.count do (
x = random 1 360
y = random 1 360
z = random 1 360
rotationobject = eulerangles x y z

rotate $[i] rotationobject
)

There are many ways of achieving this. This is but one of them. $[i] becomes the array of selected objects.



read 473 times
8/19/2009 5:20:51 PM (last edit: 8/19/2009 5:23:33 PM)
show user profile  RedStar
Make a script for more viewports =)
read 445 times
8/19/2009 10:41:29 PM (last edit: 8/19/2009 10:41:29 PM)
show user profile  parkerfamily
thanks nik. i was thinking about using arrays, wasn't sure if they would help though and was still hazy on them.
read 439 times
8/19/2009 11:23:00 PM (last edit: 8/19/2009 11:23:00 PM)
show user profile  parkerfamily
new script

for i = 1 to $.count do
(
$.height = random 1 100
$.width = random 1 360
$.length = random 1 360

x = random 1 360
y = random 1 360
z = random 1 360
rotationobject = eulerangles x y z

rotate $ rotationobject

a = random -50 50
b = random -50 50
c = random -50 50

move $ [ a, b, c]
)

that one randomizes size, rotation and position, but i copied what nick said exactly but it's still doing the same thing for all of them. i'll try rereading dub's stuff on arrays again.




i still don't get scaling though, so this script only works on boxes, cause i randomized length width and height as a work around.


edit: got it. it's scale $ not $.scale or $scale or scale$, and it requires a point 3. now i have control of all 3 basic buttons... and while searching google for scale i found out how to manipulate vertexes sorta. you can say

for obj in $ do
(
scale obj.selected verts = [0, 0, 0]
)
to scale the verts you have selected on each object exactly to the middlepoint. i might actually make myself a button for that, to save time welding.

edit: damn, selected verts isn't an actual syntax.... ohwell. i'll leave figuring out edit poly maxscript for another day, it's time for me to go to bed.
read 436 times
8/19/2009 11:30:27 PM (last edit: 8/19/2009 11:41:50 PM)
show user profile  Garp
Nik's example works fine.
If you say for i=1 to $.count do, you use the selection set as an array and you need to access each element of it with an index: rotate $[i] rotationObject.
In your script, you just rotate the whole selection at once several times ($.count times).

An alternative to Nik's is to loop through the selection as a collection with for obj in $ do and using rotate obj rotationObject.




read 426 times
8/19/2009 11:58:02 PM (last edit: 8/19/2009 11:58:02 PM)
show user profile  parkerfamily
oh, i left out the I. didn't see that. i'll try both those, cause loop was what i was thinking in the beginning.
read 401 times
8/20/2009 10:36:18 AM (last edit: 8/20/2009 10:36:18 AM)
show user profile  parkerfamily
for obj in $ do
(
d = random .5 2
e = random .5 2
f = random .5 2
scale obj [d, e, f]
x = random 1 360
y = random 1 360
z = random 1 360
rotationobject = eulerangles x y z

rotate obj rotationobject

a = random -50 50
b = random -50 50
c = random -50 50

move obj [ a, b, c]
)


the loop thing worked beautifully for me. and you can just turn the scale into all of one letter to make it uniform scale.
read 397 times
8/20/2009 10:42:37 AM (last edit: 8/20/2009 10:42:37 AM)
show user profile  horizon
Now go and make a menu window where you select the ranges with sliders.
Then wrap it up in a macro so it can be installed in the menu bar.

That'll keep you busy for a while


read 391 times
8/20/2009 11:06:07 AM (last edit: 8/20/2009 11:06:07 AM)
show user profile  parkerfamily
will go looking for input box buttons tut, doesn't seem like it should be too hard if i can figure out how to link an input box to a random option.
read 380 times
8/20/2009 11:33:21 AM (last edit: 8/20/2009 11:33:40 AM)
 
First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
 
#Maxforums IRC
Open chat window


Support Maxforums.org