Home Technical Talk

pbRenderableCurve Maya Script

passerby
polycounter lvl 12
Offline / Send Message
passerby polycounter lvl 12
Little tool for maya i been making that simulates the same effect as renderable curves in 3ds max.
pbRenderableCurve01.jpg
pbRenderableCurve02.jpg

DOWNLOAD:
http://rightsomegoodgames.ca/scripts/pbRenderableCurve.zip

GITHUB:
https://github.com/cmcpasserby/pbRenderableCurve

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    managed to fix the 2014 bug, and it is merged back into the main download now, so the main download should work for all maya versions post 2012 now.
  • Beddall
    Options
    Offline / Send Message
    Beddall polycounter lvl 6
    Hey,
    for me the shell option completely breaks the model. Doesn't so much look like it's overblowing the mesh to massive proportions... more like it's just not working as expected.

    also, is there a way to get rid of the twist in the mesh?
    I've tried rebuilding the mesh. no joy.
    sorry if there's a really obvious answer to that question, I've been away from maya for a year or so and never really did much curve work with it anyway.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    The shell part is doing a simple extrude along the normals, so it well not work very well if the mesh is twisted.

    The twist part i could add a option to it follow the curve normals, but it dosnt hold its shape as well in that case. Genrally if you play wit hthe CV where the twist is a little it will fix its self.

    Will see if i can find a way to work around that twisting glitch in the future.
  • Beddall
    Options
    Offline / Send Message
    Beddall polycounter lvl 6
    hey,

    Just tested it with a curve that had no twist in it.
    the shell modifier still goes mental. not sure why that would be as the mesh looked really clean, not even a hint of a twist.

    I've attached a pic.
    I'm sure it must be user error on my part, and thanks for taking the time to reply

    cheers
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I will have to look into a new approach for that. Does that still happen if you delete history select the mesh and do a extrude ?
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Think i fixed the shell bug, can you grab a copy of the script from here and let me know if you still have problems with the shell option.

    https://github.com/cmcpasserby/pbRenderableCurve/blob/master/scripts/pbRenderableCurve.py
  • Beddall
    Options
    Offline / Send Message
    Beddall polycounter lvl 6
    hey,

    Just for future reference, how do I download the code from github.... I copied and pasted it into the existing python script. seems to work now tho.

    Even with twists the shell modifier works perfectly. just a shame about those twists. Wonder if there is a way to constrain the curve 'normals'? to an axis or something?

    Thanks for looking into that bug. I for one really appreciate it, as I'm sure loads of other people will too :)

    cheers
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I put full control of the normal constraint into the UI for the dev builds.
    let me know if you have any problems with it before i put it into the stable branch.

    https://github.com/cmcpasserby/pbRenderableCurve/blob/develop/scripts/pbRenderableCurve.py

    also to easily save things from github click raw above the file, than press control+s or do a save as in your browser. Less chance of indentation getting messed up this way, since incorrect indentation in python can change the meaning of code.
  • Beddall
    Options
    Offline / Send Message
    Beddall polycounter lvl 6
    Hey,

    Just been playing around with it. It works perfectly. :) it's like the best thing ever!
    Just out of interest tho. What is it that the 'Use Normal' option is actually doing? I've looked everywhere for an attribute to change that would give me this behaviour but found nothing.

    thanks again... this script is AWESOME!

    cheers
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    after you make a curve renderable, select it, and in the attribute editor select the tab for its stroke. Should be called something like StrokeShape1, and in there in the "Normal Direction" box you will see, "Use Normal" and input box's.

    That is the attribute use normal is editing.
  • Beddall
    Options
    Offline / Send Message
    Beddall polycounter lvl 6
    oh i see!,

    I was selecting the curve in the viewport. (got so used to using Max I forgot about different nodes in the outliner) So is this script using paintfx to create the thickness? That's pretty cool.

    cheers
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya uses paintFX, my original approach was to simply generate a circle and extrude it along the curve, but it didnt hold its volume very well on tight angles. So i came up with this approach which gave me more options in the end as well.

    Can be complicated to wire by hand, but Maya does have some incredibly powerful nodes it can use that rival the functionality of the modifier stack in max. Just with out scripting a lot of it isn't very user friendly.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I implemeanted these changes into the release now so version 1.03 can be downloaded from.
    http://rightsomegoodgames.ca/scripts/pbRenderableCurve.zip
    now.

    Changes include some code cleanup, the shell bugfix and the addition of the normal constraint feature to prevent twisting of the mesh.
  • JohnnyP
    Options
    Offline / Send Message
    Hi - quick question - is it possible to edit the geometry this creates? I's like to select faces and vertex's but cannot see how. Thanks for such awesome scripts!!
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Ya its possible but you will have to select the geometry in the outliner and make it selectable again.

    This works best if you delete history first so the Geo you are editing it no longer influenced by the curve.

    I disabled selection on the geo since weird things can happen when you edit Geo that is still being effected by a curve, so I always could add a option to delete history and re enable selection in the ui.
Sign In or Register to comment.