PDA

View Full Version : Maxscript simpleMod



Zeph
November 29th, 2012, 05:56 PM
I'm looking at making a pipeline for building geometry sitting on the inside of a cylinder. Think space game stuff on the inside of an O'Neill cylinder or a smaller space station. I was planning on using the bend modifier to get the "three point perspective look" on geometry to help visualize how I should be building geometry and such.

For the life of me I can't figure out how to properly control the fuckin gizmos on this thing. No matter what I do, I cant seem to figure out what Autodesk was thinking when they coded this thing.

Rotating the gismo allows me to properly control the direction things bend.
Scaling the gizmo box doesn't seem to have any directly related effect. Scaling the gizmo under the -360 angle bend to where the geometry is the desired size shows that the box isn't the same size as the plane when at a zero angle bend.
I no longer have any idea what the center gizmo is.

Anyone have a clue how this thing actually works? I'll end up with a maxscript tool to deform regular geometry based on the radius of the cylinder it's going in if I can figure this out.

neuro
November 30th, 2012, 03:28 AM
okay

see that modifier stack you have therere on your object?
the bit with the Bend modofier on it and the lightbulb next to it?

there's a + there, hit that + and fold it out.

first thing to keep in mind, is that the 'bounding box' of your bend only serves to illustrate the bending action going on, it doesn't do anything in the way of 'your stuff has to be inside the box'
it'll always apply to everything, and ONLY what you have selected (just object, face selection, edge selection, etc)

-center-
now what you want to to first, is realise that 'center' is a stupid fucking name, it should be called 'starting point'

when you can do is click on the 'center' and activate it so you can change it.
you can move it up and down length-wide, to tell it where it should start bending from

let's you have say the top half of a cylinder selected.
what you're going to want to do to prevent it from FUCKING EVERYTHING UP, is grab the center, and move it down into the bottom edge, where your selection of faces starts (in this example, in the middle of the cylinder)

that's the first thing, the second thing is, you can also move it left and right (in and out relative to the direction of your bend)
this controls the radius of your bend.
easy enough to see how this works if you just try it, it's tricky to explain more than 'it changes the bend radius.

-gizmo-
what you can do with the gizmo, is basically an extension of your 3 preset bend axes.
depending on your object orientation and transforms, none of these axes can give you the result you need.
i'm sure you've seen the crazy self-intersecting-shit it sometimes puts out.
this is where the gizmo comes in.

after setting the center, you can set it to the bend-axis which is the closest to what you want to get (even if it's oriented wrong) and then use the gizmo to change it.
say something bends to the left, but you want to bend it down isntead, take the gizmo, rotate it 90 degrees, and it'll bend down (or up lol)
it's pretty self explanatory

often, rotating stuff 90 degrees in whatever direction you need is all you need with this, but you can do quire a bit more with it (moving, scaling) but you really won't have to use this very often, if at all, ever.

hope that helped.
sorry in advance if i mixed something up, i wrote this off the top of my head

also, protip for everyone, start learning maya, max is going out of production so to speak, and maya will be the new standard, unfortunately.

Zeph
November 30th, 2012, 01:59 PM
also, protip for everyone, start learning maya, max is going out of production so to speak, and maya will be the new standard, unfortunately.

I heard rumors of this, but I've never found anything solid on it. I honestly don't understand why they would do that after all the work they've spent on making Max much better than Maya. You have anything solid on that?


And as for all that, I think center is a decent name if you limit the effect.
Yeah, the crazy self-intersecting shit is how I figured out that it doesn't uniformly bend by default. I had to rotate the gizmo until I found the proper bend, but it was still squished.
At this point, I'm almost ready to consider the bend modifier flawed. I feel like I'd get along better just writing a proper modifier through the sdk.

neuro
November 30th, 2012, 07:49 PM
naw bend works perfect, i think the issue you're having, is that you scaled on object-level, and it'll push that trough your modifyer.

you want to go into the ulitities tab (the hammer tab on the right) and find the Reset X-form.
hit it, and then click ''apply reset X-form' and then collapse it down to your object, and try to bend it again.

scaling stuff on object level is generally not advised if you're not aware of the reset X-form.
i think you'll find that this was what was causing your non-uniform bending.

as for max/maya

nothing that i can share.
max is going the way of Gmax

Zeph
December 1st, 2012, 03:30 AM
Nah, man. Definitely not object manipulation.
You can even see that by default after orienting the gizmo the extrusions that should come together at 120 degree angles are much closer the being parallel than anything else.
http://modreality.net/bendfffffffff.jpg

neuro
December 1st, 2012, 06:36 PM
uhhhhhhhhhhhhhhh wtf am i looking at? :)

PenGuin1362
December 1st, 2012, 07:42 PM
also, protip for everyone, start learning maya, max is going out of production so to speak, and maya will be the new standard, unfortunately.

I think it will still be relevant in the industry for a few years. We have both at work but most people use Max there so I'm sure even if 2014 doesn't show (or is crap) they'll still use '13 for a few more years. Plus Max 2013 is pretty solid update from what I've seen so far. Doesn't hurt to learn both though, pretty helpful when lookin for a job.

Also what are you trying to do? Do you want those boxes to protrude out from the cylinder, have them be rings around it? Wat?

Zeph
December 1st, 2012, 11:14 PM
uhhhhhhhhhhhhhhh wtf am i looking at? :)

A plane that gets bent using the Bend modifier.
Said plane's width is the same as the circumference of a circle with a radius of 100.
Extrusions are made at points where the surface would be divided into thirds.
Applying the modifier shows that on default settings it's not actually bending uniformly to scale.
The rest shows that scaling the gizmo can actually get a correct result and draws up my original question.

Any way to figure out how to correctly get the amount needed to scale the gizmo?

paladin
December 3rd, 2012, 01:56 PM
also, protip for everyone, start learning maya, max is going out of production so to speak, and maya will be the new standard, unfortunately.

While I agree it is a good idea to be familiar with both packages, what you said isnt completely true. I work for a AAA studio with 250+ employees and we have the option of using what ever we prefer. Hell, my studio still uses max 10. Max is still far more superior than maya in a lot of ways, much like maya is superior to max in others. Depends on the person and workflow.

neuro
December 5th, 2012, 03:02 AM
While I agree it is a good idea to be familiar with both packages, what you said isnt completely true. I work for a AAA studio with 250+ employees and we have the option of using what ever we prefer. Hell, my studio still uses max 10. Max is still far more superior than maya in a lot of ways, much like maya is superior to max in others. Depends on the person and workflow.

yeah, you're right, but the switch is happening.
i get to keep using max because i have 12 years experience with it, and it'd be stupidly unproductive to have me switch over to maya right away.
i'm just sayin' start getting familiar with maya, because chances are you're going to need it.
(or you can get lucky and stick with a max-based company for life, though that's going to change as well)

Zeph
May 6th, 2013, 10:32 AM
So, yeah I'm revisiting this after finding scripted plugins and I wound up with some huge issues since I haven't mathed in so long. But yeah, once I sat down with napkins and a pen I removed everything that was unnecessary and found the problem (maxscript working in meters while Max units set to centimeters). It's cut down in features, such as picking your own axis and such, but works as intended.

I don't know when/if I'll get around to implementing things like picking an axis or using the gizmo to set polar origin. It does pretty much everything I need in terms of getting geometry to the form I need for export to engine right now.

Anyways, since you didn't really seem to get what I was aiming for, he's the modifier applied to blood gulch and the radius adjusted where the bounding box's min/max bounds roughly meet.

http://modreality.net/herpderpyl.jpg

It hurts, and rightly so. When starting on my game, I initially wanted a relatively small radius on these things, but it's so damn disorienting at most times. A radius of about 100 meters is what I'd consider the bare minimum for reducing disorientation (unless you're mostly surrounded by interior geometry and only able to see a limited portion of the wrap-around). When pretty much entirely outside, things start to seem more normal when you push beyond a 150 meter radius. Here's a simple video illustrating it.

Y28pcZUr6T4
http://modreality.net/herpderpl.flv -- youtube kinda butchered it since it was already compressed.