v9.0 -- mcjBuilderA - script to build anything in Daz Studio - updated sept. 16 2017

1567911

Comments

  • mCasualmCasual Posts: 4,604
    edited December 1969

    yay @ the first scripted insertion of a "Path Cap" ( the tartan floor )

    which means there's a more than faint possibility we'll get Beta 7 on Sunday

    for this version only horizontal path caps will be properly handled

    if you have many meshes generated by your path script, using the
    "break" command, then each one can have its own path cap


    Profile square
    Turn 360
    pathCap
    
    yaypathcaps.jpg
    1920 x 1080 - 683K
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    Beta 7?

    Looks great! :-)

  • mCasualmCasual Posts: 4,604
    edited December 1969

    i posted 6.98 saturday it has most new fixes and features
    the manual was extended

  • IndigoJansonIndigoJanson Posts: 1,100
    edited December 1969

    Congratulations on all the progress! It's an exciting project.

  • mCasualmCasual Posts: 4,604
    edited May 2014

    testing caps on more than 1 sub-mesh
    each submesh ( see break command ) can have its own material
    the path-cap material has the same name but with the _pathCap
    ( should i use a dash and avoid underscores? hmm
    important to remember which one LuxRender dislikes)

    in the case below, the "default" material is used, so all path-caps use material

    
    define donut
    Profile basic
    Turn 360
    pathCap
    break
    TransX 2
    defineEnd
    
    TransX -2
    TransY .001
    donut
    donut
    donut
    TransX -5
    TransZ 1.8
    donut
    donut
    
    
    multimes.jpg
    1920 x 1080 - 365K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    added code to avoid crashing on nonsensical path-caps

    3 sided path caps are sensical

    ( interesting that auto-correct accepts "nonsensical" but doesnt accept "sensical"

    
    ring
    move 1
    rotate 45
    setScaleX 1.4
    ring
    setScaleX 1
    rotate 45
    move 1
    ring
    pathCap
    
    

    someday mcjBuilder will possibly be able to output more than 1 .obj file

    or even, output it as a multi-part figure


    ------
    figure 6 i didnt really take time to make credible bread texture
    but anyway if you need a good bread texture
    see here: http://hhh316.deviantart.com/art/Brown-bread-seamless-182658273

    foggybread.jpg
    1920 x 1080 - 575K
    spread.jpg
    1920 x 1080 - 171K
    toasted.jpg
    1024 x 1024 - 174K
    foto_alla_pioggia.jpg
    1920 x 1080 - 886K
    tri.jpg
    1920 x 1080 - 1M
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    ~~~~ mcjBuilderA news ~~~~

    i just want to correct the way the closed-path textures behave

    then i'll post * ! * ! Beta 7 ! * ! *

    in the bread image seen above
    the bottom edge of the bread was obtained by using the closePath command
    and that extra segment's UV map is stretched, which is what i'll correct now

    .
    .
    .
    ... turns out i will not modify the closePath texturing technique for now

    since it can produce good results the way it's set up

    and we wont have to deal with any errors introduced by an attempt to fix it

    the trick is to understand that closePath doesn't create the closing segment of a path
    instead, it deletes the last ring, and connects the ring before that one to the first ring of the path
    but we keep the valuably correct UV coordinates of the last ring.

    but but i have to see if this works well with multi-mesh paths
    because i suspect it doesn't

    Amyondeck.jpg
    1920 x 1080 - 1M
    undaztan.jpg
    1600 x 800 - 49K
    turnsout.jpg
    1920 x 1080 - 1M
    bzzzt.jpg
    1920 x 1080 - 938K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    last thing to fix ... multiple closed-path shapes

    ( which, at least, don't crash the script )

    fig 2 Tada ! i think i got it

    you know, using just mcjBuilder one could build a whole castle !

    for this version Beta 7 we have ebdCaps and pathCaps, in Beta 8 we'll get vertexCaps

    
    Profile classic_torustop
    MoldSize 50 100
    ClosePath On
    Tread 200
    StepAngle 45
    
    Turn 360
    PathCap
    break
    
    TransX 10
    Turn 360
    PathCap
    
    tadaithinkigotit.jpg
    1920 x 1080 - 1M
    multu.jpg
    1920 x 1080 - 1M
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    Beta 7 Has Arrived !!!!!!!

    ( said with the voice of Morgan Freeman ( on helium ) )

    5 minutes before midnight

    so i sort'of reached my weekend deadline

    mcjBuilderA.dsa_.png
    91 x 91 - 5K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited December 1969

    undulating curtains using mcjBuilderA Beta 7

    
    Profile walltop
    MoldSize .1 100
    closeprofile off
    Tread 10
    ClosePath off
    
    // note: alcovity is multiple of stepa
    var stepa 30
    var alcovity 270
    StepAngle stepa
    Rotate -(360-alcovity)/2
    Ring
    repeat 6
    Radius 1
    Turn alcovity
    Radius 1
    Turn -alcovity
    repeatEnd
    
    270.jpg
    1280 x 720 - 516K
  • mCasualmCasual Posts: 4,604
    edited December 1969

    something that could be used as a base dor a ruffle-edge skirt

    Profile walltop
    MoldSize .1 100
    closeprofile off
    Tread 10
    ClosePath off
    
    // note: alcovity is multiple of stepa
    var stepa 30
    var alcovity 270
    StepAngle stepa
    Rotate -(360-alcovity)/2
    Ring
    repeat 12
    Radius 1
    Turn alcovity
    Radius 1
    Turn -alcovity-30
    repeatEnd
    trytrytry.jpg
    1280 x 720 - 410K
  • mCasualmCasual Posts: 4,604
    edited December 1969

    hey i figured something !

    minimally, mcjBuilderA animates a node

    if you rename this node to something else

    and run mcjBuilderA again, you can animate another node with a slightly different pattern

    then using mcjRibbons, you can turn those nodes into something quite complex!

    ... like a pleated/ruffled skirt

  • mCasualmCasual Posts: 4,604
    edited May 2014

    h y p e r A d v a n c e d t r i c k
    : using mcjBuilder to add a dress edge to the Aiko3 bodycon

    mcjBuilder can use the services of the daz scripting engine

    for example when you do

    Move sin(3.1416)

    it's the daz scripting engine that computes sin(3.1416)

    in version Beta 7 you don't have direct access to some neat objects like the Scene object

    ( well you do if you create a DzScript() )

    but in version 8 you will

    as a bonus you'll have quick access to the positions of the vertices of any selected object

    Here i used this to build a dress edge !

    it worked because the free mcjA3Bodycon's vertices are all neatly sorted

    
    define walk i
    Tread 1
    var x getX(i)
    var y getY(i)
    var z getZ(i)
    var a getA(i)
    MoveTo x y z
    SetRotY a
    Ring
    defineEnd
    
    repeat 64
    walk count
    repeatEnd
    
    fuffu.jpg
    1280 x 720 - 211K
    xmas.jpg
    1280 x 720 - 125K
    hyperadvanced.jpg
    1280 x 720 - 122K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    very cool there Casual!

  • mCasualmCasual Posts: 4,604
    edited December 1969

    RAMWolff said:
    very cool there Casual!

    thanks!

    i think i'll finish the gothic walls/chapel
    then the castle's stairs ( the original impetus )

    then it's back to the physics engine wasnt it?

    ennis.jpg
    1920 x 1080 - 794K
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    All made from your script? AMAZBALLS!

  • mCasualmCasual Posts: 4,604
    edited May 2014

    in case you're new to mcjBuilderA, here's a rush introduction

    the 12 columns behind Aiko3 were created using the free Daz Studio script mcjBuilderA Beta 7

    To describe mesh creation, we use the analogy of "extrusion"
    some solid material is pushed through an imaginary hole/nozzle
    The shape of this nozzle is referred to as the "extrusion profile" or "molding shape"

    you select one of the 124 profile curves (nozzle shape), in this case a gear shape

    you specify a profile size, in this case 1 ft by 1 ft ( which explains why the columns have a diameter of 1 ft

    you specify a "Tread" length, in this case 1 ft -

    From now on, if you order to advance the nozzle by12 steps, it will advance 12 ft

    you compose an "extrusion path script" which is a series of commands in text format

    you press the "Build button, it builds the object you designed and writes it to an .obj file on disk

    you press the "load" button and badabing your object is in the Daz Studio world

    lets go line by line over the "extrusion path script"

    
    define acolumn
    Ring
    Move 12
    Ring
    break
    Move -12
    MoveX 2
    defineEnd
    
    rotateX -90
    
    MoveTo -6*2 0 -1*2
    
    repeat 12
    acolumn
    repeatEnd
    

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    define acolumn

    we begin the definition of a block of commands
    we chose to call this block of commands an "acolumn"

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Ring

    wherever we are in space
    we dump a ring of vertices, that ring has the shape
    of the selected profile curve, in this case a gear shape
    for now they are just points in space

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Move 12

    we advance 12 steps forth ( 12 ft )

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Ring

    wherever we are in space
    we dump a second ring of vertices
    We have two rings and that's all we needed
    The script builds a tube going from the first ring to the second one
    We now have a 12 ft long gear-shaped tube

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    break

    this tells mcjBuilder to stop building tubes
    so now, if we move and create a third Ring,
    there wont be a tube going from the second ring to the third ring

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Move -12

    we move back 12 ft, so we're exactly where we started

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    MoveX 2

    Move to the right, 2 ft

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    with those 2 moves
    whoever invoked the "acolumn" knows
    where the "extrusion nozzle is located" ....
    right where it was before the invocation
    but 2 ft to the right

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    defineEnd
    we're signaling the end of the definition
    of what we chose to call an acolumn

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    so far we didn't create an acolumn!!
    we only defined what an acolumn is

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    rotateX -90

    when mcjBuilder starts the "extrusion nozzle" is
    oriented just like Daz Studio's default camera
    if the nozzle were to move forth,
    it would move toward Aiko3
    so we rotate it around the X ( red arrow ) axis
    -90 degrees, the nozzle is facing the sky

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    MoveTo -6*2 0 -1*2

    remembering that Tread = 1 ft
    this means:
    move the extrusion nozzle to the x y z coordinate
    -12 0 -2

    so, 12 ft to the left, at ground level, 2 ft behind Aiko
    ( who is currently standing at 0 0 0 )

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    nothing was created yet, we only defined what's an acolumn
    and we moved the extrusion nozzle at the position
    where we want to build the first acolumn

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    repeat 12

    this tells mcjBuilder to ....do .... whatever follows ... 12 times
    ( and to stop when it encounters the word repeatEnd )

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    acolumn

    create an acolumn, right here!

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    repeatEnd
    

    this signals the end of the things we told mcjBuilder to repeat 12 times

    yoyou.gif
    480 x 270 - 1M
    extri.jpg
    800 x 450 - 34K
    cordon.jpg
    1879 x 593 - 157K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    oh my i made a video in May :)

    * * * Here's pointing at you * * *

    https://www.youtube.com/watch?v=1PD75e8vF-k

    ( not proud of my youtube channel productivity, i used to make a lot of videos ! )

    pointers.jpg
    1280 x 720 - 184K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    Hmmm, that's not a good link. It takes me to MY Videos which I haven't uploaded any so ... lol

  • mCasualmCasual Posts: 4,604
    edited May 2014

    RAMWolff said:
    Hmmm, that's not a good link. It takes me to MY Videos which I haven't uploaded any so ... lol

    maybe here https://www.youtube.com/watch?v=1PD75e8vF-k

    the title is "Here's pointing at you" so you could find it that way

    -------
    ( mcjSuperLathe curve converted into an mcjBuilder path )

    ukulelesho.jpg
    1280 x 720 - 203K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    Neat. So your saying that one could create all sorts of stuff with your script, which so far from looking through all the posts, you can indeed. Are they auto UV'd or is that a separate script?

  • mCasualmCasual Posts: 4,604
    edited December 1969

    RAMWolff said:
    Neat. So your saying that one could create all sorts of stuff with your script, which so far from looking through all the posts, you can indeed. Are they auto UV'd or is that a separate script?

    auto-UV

    it makes tubes and caps

    the list of commands you supply bends and stretches those tubes

    the shape of the tube is one of the 124 bundled curves - but you can also make your own

    aiiia.jpg
    960 x 720 - 383K
  • RAMWolffRAMWolff Posts: 10,146
    edited December 1969

    Neat. OK... I'll have to try to find the time to test this out. Currently I'm trying to get all my personal items I made that I had in DAZ Studio set back up with Smart Content data as my upgrade to 8.1 started DAZ Studio from scratch and all that went away for some stupid reason. So time consuming this content data stuff.

  • olmilolmil Posts: 10
    edited December 1969

    hey Jacques,

    I play for three days with yours BuilderA.*
    and now I think I'm comfortable with, I must tell you

    your script is toooooooooooo much Top !!!

    not only fun to play with but, for me,
    it learn many things taking a look inside

    and it seems anything is doable with it.

    love this type of open tools instead of
    premade ones

    sorry for my english

    congratulations for all your work and
    thanks, thanks, thanks

    one thing else, perhaps tou know it:
    does'nt work in Ds 4.6 (release 3.50)
    cause line 20 hangs (var rxChunk ...)
    log says
    "SyntaxError: Invalid regular expression:
    range out of order in character class"

    a pity, sure you can do something in the next releases

    Thank you again and keep on :)

  • mCasualmCasual Posts: 4,604
    edited December 1969

    olmil said:
    hey Jacques,

    ...
    one thing else, perhaps tou know it:
    does'nt work in Ds 4.6 (release 3.50)
    cause line 20 hangs (var rxChunk ...)
    log says
    "SyntaxError: Invalid regular expression:
    range out of order in character class"
    ...

    thanks for the tip !
    i'm always using DS3A because 4.6 tends to crash on my PC

    i'll post version Beta 8 very soon
    it fixes an issue with closePath

    still thinking about adding repeat-within-repeat

    but arrays could be done using

    
    var spacing 2
    var len 7
    
    define acolumn x z
    MoveTo x*spacing 0 z*spacing
    Ring
    Move len
    Ring
    endCap
    break
    defineEnd
    
    rotateX -90
    
    repeat 16
    var row Math.floor(count/4)
    var col count%4
    acolumn row col
    repeatEnd
    
    fakearrays.jpg
    1920 x 1080 - 486K
  • mCasualmCasual Posts: 4,604
    edited May 2014

    mcjBuilder news

    Beta 8 will be DS 4 compatible, it was only DS3 compatible

    here's the first semi-succesfull run !

    it built the caps, it created the vertices for the tube

    but didn't .... oh wait .... nah ... it didn't build the tubes

    .... oh i know ! wait wait

    ah ha! it was fully functionnal, it's just that i told it to close the path
    close the "ring of tube"
    but our ring of tubes, was just a straight tube
    the result was a zedo-length tube
    but as you can see in Figure 3
    when we turn off the closePath option, everything works A-OK !

    i'll test all the features and post Beta 8

    technically, to make the script DS4 compatible

    i had to replace

    
    var rxChunk = new RegExp( /[a-zA-Z_][a-zA-Z0-9_]*|[-+]?[0-9]*\.?[0-9]*|[+-\*\/()]/g )
    

    with

    
    var rxChunk = new RegExp( /[\+]|[\-]|[\*]|[\/]|[a-zA-Z_][a-zA-Z0-9_]*|[\+\-]?[0-9]*\.?[0-9]*/g )
    

    this is used to parse your statements
    and turn them into lists of operators and
    numbers and function names and variable names

    oops lets not forget the parenthesis !

    
    var rxChunk = new RegExp( /[\+]|[(]|[)]|[\-]|[\*]|[\/]|[a-zA-Z_][a-zA-Z0-9_]*|[\+\-]?[0-9]*\.?[0-9]*/g )
    

    ( i'm not very RegExperienced )

    yaepp.jpg
    1920 x 916 - 333K
    ohmyall.jpg
    1094 x 610 - 80K
    ohmymy.jpg
    634 x 670 - 22K
    Post edited by mCasual on
  • Miss BMiss B Posts: 3,071
    edited December 1969

    Oh that last screenshot looks like tall stacks of coins. ~LOL~

  • mCasualmCasual Posts: 4,604
    edited May 2014

    stay tuned ( or tune back in, it's not like you need to stay tuned and wait here doing nothing )

    this evening i'll post mcjBuilderA Beta 8 with Daz Studio 4.6 compatibility
    it also will include access to the "Scene" object for your path scripts
    maybe also access to the positions of the vertices of the selected object
    so you could for example make your script build something that fits a figure!
    ---

    i dont post it immediately because i want to perform a few dozen test runs before posting it ....

    ----
    in the image below, the grid-walls were created in Daz Studio 4.6 using this mcjBuilderA path script

    
    // grid
    profile square
    profileSize 1 1
    profileUnits cm
    tread 10
    pathUnits cm
    closePath off
    
    define bar
    Ring
    Move 10
    Ring
    Move -10
    MoveX 1
    break
    defineEnd
    
    moveTo -5 0 -5
    repeat 11
    bar
    repeatEnd
    
    rotate 90
    
    moveTo -5 0 5
    repeat 11
    bar
    repeatEnd
    
    profileSize 2 1.5
    
    moveTo 0 0 5
    Ring
    
    repeat 4
    Move 5
    HardTurn 90
    Move 5
    Ring
    repeatEnd
    
    break
    
    setRotY 0
    moveTo 0 0 -5
    Ring
    Move 10
    Ring
    

    figure 2 - DS soft render .... i could do better than that but gotta return coding !

    figure 3 - Testing materials and caps

    see how i obtain numbered material names using the "repeat" counter

    
    repeat 4
    Material "mat"+count
    theletterF
    repeatEnd
    
    sisi.jpg
    910 x 910 - 421K
    stepout.jpg
    910 x 682 - 552K
    aiko5.jpg
    1600 x 1200 - 453K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    release will be ... in the night

    because thorough testing is a good idea and is ongoing

    testing is not uneventful :)

    notuneventfull5.jpg
    910 x 910 - 501K
    notuneventfull4.jpg
    910 x 910 - 289K
    notuneventfull3.jpg
    910 x 910 - 436K
    notuneventfull2.jpg
    910 x 910 - 424K
    notuneventfull.jpg
    910 x 910 - 287K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited May 2014

    more Beta 8 in DS 4.6 succesful tests

    release in 45 minutes ... tic toc tic toc


    ... who will be the first to build a castle ?
    i mean like a fortress

    sorry if i'm taunting you!

    french-taunting.jpg
    629 x 340 - 25K
    notuneventfull9.jpg
    910 x 910 - 524K
    notuneventfull8.jpg
    910 x 910 - 361K
    notuneventfull7.jpg
    910 x 910 - 431K
    notuneventfull6.jpg
    910 x 910 - 315K
    Post edited by mCasual on
Sign In or Register to comment.