Home Technical Talk

3ds max - Creating a custom primitive?

polycounter lvl 19
Offline / Send Message
TorQue[MoD] polycounter lvl 19
Hey all,

Months back I saw a video where someone had created their own custom primitive object for 3ds max of a Lamp Post where after placing the object in the scene, there were multiple parameters that you could adjust, for example the length of the vertical pole, the length of the horizontal pole and I think the scale of the light itself.

I was wondering if there are any tutorials out there that show how to do this?
I was able to find http://www.scriptspot.com/3ds-max/scripts/primitive-maker which is awesome, but the only parameter is the scale which isn't nearly as useful.

Replies

  • Mark Dygert
    Options
    Offline / Send Message
    That's one area of maxscript that they haven't upgraded in years and I don't think anything has changed in the way they handle custom primitives...

    They allow you to create snapshots of editable mesh objects just like the script does and then vomit those back into your scene, and you can adjust it through script on the object level but there isn't any kind of support for a deeper level of custom attributes.

    Some people get around this by setting up a subdivision attribute which is just subdividing the mesh, or defining the height or width but they are just adjusting the objects scale.

    You can get creative and add in other modifiers as attributes but you're pretty much stuck there.

    You can also store a library of custom primitives that are slight variations and then based on what settings the person picks spit out that specific mesh.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Interesting. So I could leave a bend modifier on a mesh and turn it into a primitive and it would always have that bend modifier on it when I create a new prim? That would be awesome!
    So in the Lamp Post example, what sort of modifier would the guy have been using to allow for adjusting the height of the pole? I was an upside down L shape and he was adjusting both lengths.
  • Mark Dygert
    Options
    Offline / Send Message
    That really depends on how much scripting they did, I don't think the primitive maker would capture modifiers I think it just captures meshes.

    But if you write your own custom primitive plug-in there is quite a bit you can do behind the scenes, most of it smoke and mirrors like, selecting specific predefined loops or polys in the mesh and allowing the user to move them in a specific way by manipulating a slider in the command panel then calling that slider something like "pipe height", it all depends on what the person can pull off in maxscript.

    Outside of the primitive maker script there isn't a non-code friendly way to create custom primitives you end up using maxscript or C++ to create the custom primitive plug-ins. It goes from crazy simple to insanely hard in the blink of an eye.
  • Mrfred
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    wow... no, honestly I didn't even think to :P

    I was hoping to find a more simple solution though rather than having to try to teach myself max script.

    Thanks Mrfred.
  • Mrfred
    Options
    Offline / Send Message
    Mrfred polycounter lvl 4
    what exactly do you need ? maybe I can script it if I have some enough time
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Oh thanks Mrfred. There's nothing specific that I need. I was simply thinking of a new way to make a low poly tree model that I could tweak values and I remembered seeing that lamp video and thought that being able to create my own primitive would be cool. Its more of a curiosity than a specific requirement but thanks for the offer either way.
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    Wouldn't morphtargets be awesome for that ? The primitive could be made of a mesh with a few targets defining height, thickness, bending, a bit of twisting, and so on ...

    (I was thinking on setting up a few base heads that way : male, female, kid, big guy - all morphable into each other ...)
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Will the primitive script actually save morph target info? I'm definitely going to have to play around and discover its limitations.
Sign In or Register to comment.