Stopped working script in DS 4.7 - Props Export - PP2 exporter 20d

Andrey PestryakovAndrey Pestryakov Posts: 172
edited November 2014 in Daz Studio Discussion

There was a good script for DAZ Studio. Worked fine in DS 4.6 - script created PP2 and optimized geometry of reducing the size for OBG.
In DS 4.7 geometry disappears ... Can you fix it?

Post edited by Andrey Pestryakov on

Comments

  • Andrey PestryakovAndrey Pestryakov Posts: 172
    edited November 2014

    There was a good script for DAZ Studio. Worked fine in DS 4.6 - script created PP2 and optimized geometry of reducing the size for OBG.
    In DS 4.7 geometry disappears ... Can you fix it?
    Is any alternative to this script to generate PP2 props from DS 4.7?

    Post edited by Andrey Pestryakov on
  • Richard HaseltineRichard Haseltine Posts: 102,363
    edited December 1969

    Merged duplicate threads.

  • Richard HaseltineRichard Haseltine Posts: 102,363
    edited December 1969

    Is this a link to the original file? You can't repost that without permission, and no one can edit the script and give you the modified version without permission. Someone could tell you how to edit it yourself, however.

  • Andrey PestryakovAndrey Pestryakov Posts: 172
    edited December 1969

    Is this a link to the original file? You can't repost that without permission, and no one can edit the script and give you the modified version without permission. Someone could tell you how to edit it yourself, however.

    I deleted the file.
  • Lissa_xyzLissa_xyz Posts: 6,116
    edited November 2014

    PP2 Export.dsa by JWAS84 and DUKE533 carries a zero-restriction copyright. Anybody's free to update/distribute.

    Portion of the file:


    /***************************************************************************
    ** PP2 exporter 2.0d
    ** Description: Export Prop with limited Mat support.
    ** Authors: JWAS84, DUKE533
    ****************************************************************************
    ** 24-02-09 ver 1a (JWAS84)
    ** (c) Copyright NONE. Use for whatever you like.
    ** ExportObj Was written by Rob Whisenant.
    ** renderIcon Was written by Guandalug
    ****************************************************************************

    I can't code for Daz to save my soul, but if someone's willing to update it to work with 4.7 I can pass it along.

    Post edited by Lissa_xyz on
  • BejaymacBejaymac Posts: 1,897
    edited December 1969

    The last version of it was actually posted on the old forums, that way people could just copy & paste it into an empty DSA, sadly that forum is long gone (as is the archive) but I do have the code from that post and can post it here if anyone wants it.

  • Andrey PestryakovAndrey Pestryakov Posts: 172
    edited December 1969

    Vaskania said:
    PP2 Export.dsa by JWAS84 and DUKE533 carries a zero-restriction copyright. Anybody's free to update/distribute.

    Portion of the file:


    /***************************************************************************
    ** PP2 exporter 2.0d
    ** Description: Export Prop with limited Mat support.
    ** Authors: JWAS84, DUKE533
    ****************************************************************************
    ** 24-02-09 ver 1a (JWAS84)
    ** (c) Copyright NONE. Use for whatever you like.
    ** ExportObj Was written by Rob Whisenant.
    ** renderIcon Was written by Guandalug
    ****************************************************************************

    I can't code for Daz to save my soul, but if someone's willing to update it to work with 4.7 I can pass it along.

    I had to put DAZ Studio 4.5, to use this script.

  • patience55patience55 Posts: 7,006
    edited December 1969

    No, it creates a .pp2 prop file.

  • Lissa_xyzLissa_xyz Posts: 6,116
    edited November 2014

    Bejaymac said:
    The last version of it was actually posted on the old forums, that way people could just copy & paste it into an empty DSA, sadly that forum is long gone (as is the archive) but I do have the code from that post and can post it here if anyone wants it.
    I managed to find a version of it posted by MFM on these current forums, dated September 2013.

    http://www.daz3d.com/forums/discussion/27536/P1035/#423087

    Looks like his last fix was for AoA's SSS.

    The script itself loads and exports, and the pp2 loads into the scene hierarchy, but there's no visual object.

    I used it just to export a standard cube prim.

    What saved into the OBJ:


    # Exported from DAZ Studio 4.7

    # cube
    v -1.98722e+18 7.28961e+19 1.98959e-23
    v 1.98722e+18 7.28961e+19 1.98959e-23
    v -1.98722e+18 -7.28961e+19 1.98959e-23
    v 1.98722e+18 -7.28961e+19 1.98959e-23
    v 1.98722e+18 7.28961e+19 -1.98959e-23
    v -1.98722e+18 7.28961e+19 -1.98959e-23
    v 1.98722e+18 -7.28961e+19 -1.98959e-23
    v -1.98722e+18 -7.28961e+19 -1.98959e-23
    vt 0 0
    vt 0.33 0
    vt 0 0.5
    vt 0.33 0.5
    vt 0.66 0
    vt 0.99 0
    vt 0.66 0.5
    vt 0.99 0.5
    vt 0.66 0.5
    vt 0.99 0.5
    vt 0.99 1
    vt 0.66 1
    vt 0.33 1
    vt 0 1
    vt 0.33 0.5
    vt 0.66 0.5
    vt 0.66 1
    vt 0.33 1
    g Default
    usemtl cube
    f 1/1 2/2 4/4 3/3
    f 5/5 6/6 8/8 7/7
    f 6/9 1/10 3/11 8/12
    f 2/2 5/5 7/7 4/4
    f 3/3 4/4 7/13 8/14
    f 6/15 5/16 2/17 1/18

    The PP2:
    {
    version
    {
    number 4.01
    }
    //
    // PP2 exporter 2e
    //
    prop cube
    {
    storageOffset 0 0.3487 0
    objFileGeom 0 0 ":Runtime:Geometries:!PP2 Export Test:cube.obj"
    }
    //
    prop cube
    {
    name cube
    on
    bend 1
    dynamicsLock 1
    hidden 0
    addToMenu 1
    castsShadow 1
    includeInDepthCue 1
    useZBuffer 1
    parent UNIVERSE
    creaseAngle 80
    channels
    {
    xOffsetA OriginX
    {
    name OriginX
    initValue 0
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue 0
    }
    yOffsetA OriginY
    {
    name OriginY
    initValue 0.12499999812268835
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue 0.12499999812268835
    }
    zOffsetA OriginZ
    {
    name OriginZ
    initValue 0
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue 0
    }
    translateX xTran
    {
    name X Translate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.001
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    translateY yTran
    {
    name Y Translate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.001
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    translateZ zTran
    {
    name Z Translate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.001
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    rotateX xRotate
    {
    name X Rotate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 1
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    rotateY yRotate
    {
    name Y Rotate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 1
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    rotateZ zRotate
    {
    name Z Rotate
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 1
    keys
    {
    static 0
    k 0 0
    }
    interpStyleLocked 0
    }
    scale Scale
    {
    name Scale
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 0
    k 0 1
    }
    interpStyleLocked 0
    }
    scaleX xScale
    {
    name X Scale
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 0
    k 0 1
    }
    interpStyleLocked 0
    }
    scaleY yScale
    {
    name Y Scale
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 0
    k 0 1
    }
    interpStyleLocked 0
    }
    scaleZ zScale
    {
    name Z Scale
    initValue 0
    hidden 0
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 0
    k 0 1
    }
    interpStyleLocked 0
    }
    xOffsetB xOffB
    {
    name xOffB
    initValue 0
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue 0
    }
    yOffsetB yOffB
    {
    name yOffB
    initValue -0.12499999812268835
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue -0.12499999812268835
    }
    zOffsetB zOffB
    {
    name zOffB
    initValue 0
    hidden 1
    forceLimits 0
    min -100000
    max 100000
    trackingScale 0.004
    keys
    {
    static 1
    k 0 0
    }
    interpStyleLocked 0
    staticValue 0
    }
    }
    origin 0 0.12499999812268835 0
    endPoint 0 0.2499999962453767 0
    orientation 0 0 0
    displayOrigin 0
    displayMode USEPARENT
    customMaterial 1
    material cube
    {
    KdColor 1 1 1 1
    KaColor 0 0 0 1
    KsColor 0.6 0.6 0.6 1
    TextureColor 1 1 1 1
    NsExponent 0
    tMin 0
    tMax 0
    tExpo 1
    bumpStrength 0
    ksIgnoreTexture 0
    reflectThruLights 1
    reflectThruKd 0
    textureMap NO_MAP
    bumpMap NO_MAP
    reflectionMap NO_MAP
    transparencyMap NO_MAP
    ReflectionColor 1 1 1 1
    reflectionStrength 0
    }
    material Preview
    {
    KdColor 0.654622 0.497543 0.861782 1
    KaColor 0 0 0 1
    KsColor 0.187072 0.0360363 0.131175 1
    TextureColor 1 1 1 1
    NsExponent 5.0
    tMin 0
    tMax 0
    tExpo 0.6
    bumpStrength 1
    ksIgnoreTexture 0
    reflectThruLights 1
    reflectThruKd 0
    textureMap NO_MAP
    bumpMap NO_MAP
    reflectionMap NO_MAP
    transparencyMap NO_MAP
    ReflectionColor 1 1 1 1
    reflectionStrength 1
    }
    locked 0
    backfaceCull 0
    visibleInReflections 1
    visibleInRender 1
    displacementBounds 0
    shadingRate 0.2
    smoothPolys 1
    }
    doc
    {
    addActor cube
    }
    }

    Post edited by Lissa_xyz on
  • NagraNagra Posts: 99
    edited December 1969

    Cool information in here. Thanks for posting the link to the script !

    Glad i made a backup of the latest 4.6 before updating to 4.7 ...

  • patience55patience55 Posts: 7,006
    edited December 1969

    Good find for the code! thanks.

  • mCasualmCasual Posts: 4,607

    i located the problematic section of the code that makes it fail in DS4.8

    around line 741 there's a line of code that reads 

     

    oNode.setWSScale( DzMatrix3() )

     

    if we replace that line with

     

    //changes by mCasualJacques July 20 2015 ** begin **

    // oNode.setWSScale( DzMatrix3() );

    oNode.getScaleControl().setValue(1);

    oNode.getXScaleControl().setValue(1);

    oNode.getYScaleControl().setValue(1);

    oNode.getZScaleControl().setValue(1);

    //changes by mCasualJacques July 20 2015 ** end ** 

     

    it appears to work !!!

    so i wont need to stay in DS3 when building my props

     

    i'll double check that the code i got has the permissive copyright clause ...

     

    yes !

    
    
    // DAZ Studio version 3.0 filetype DAZ Script
    
    
    /***************************************************************************
    
    ** PP2 exporter 2.0b
    
    ** Description: Export Prop with limited Mat support.
    
    ** Authors: JWAS84, DUKE533
    
    ****************************************************************************
    
    ** 24-02-09 ver 1a (JWAS84)
    
    ** (c) Copyright NONE. Use for whatever you like.
    
    ** ExportObj Was written by Rob Whisenant.
    
    ** renderIcon Was written by Guandalug

     

    yes !!!

     

    so i'll post the DS4.5+ compatible version on my site and on a Forum Thread

     

     

  • mCasualmCasual Posts: 4,607
    edited July 2015

    well actually i better build or obtain a correct DzMatrix3

    in case the parent note has non-unity scaling

    so i wont use the getXScaleControl().setValue(1) way

    it will be

    oNode.setWSScale( DzMatrix3(1,0,0,0,1,0,0,0,1,0,0,0) ); if we're in DS4.5

    and if we're in DS 3 it will be the old code or this one if it's compatible

     

    and i'll fix the disappearing buttons issue 

    and there's an error in the props that make their default scale 0 instead of 1,

    so when you "zero" most of my props, they disappear because they get scaled to 0% !

     

    so around line 393

     

    /* mCasualJacques change - important that the default zero scale is 1 not 0 */
    
    //writeLine("initValue 0");
    
    writeLine(String("initValue %1").arg( nVal ));
    
    /* mCasualJacques change - important that the default zero scale is 1 not 0 */

     

    Post edited by mCasual on
Sign In or Register to comment.