technical question to morph controllers and x/y/z translates of primitives

cosmo71cosmo71 Posts: 3,609
edited December 1969 in The Commons

hello,

I have a question to morph controllers and x/y/z translates of primitives.

Is it possible to connect one of the translates of a primitive to a morph of a figure?


an example (really just an example just to show what I mean):

I have a bottle with morphs (wider,higher,deeper) and to fill the bottle I put a cylinder in it and parent the cylinder to the bottle.

I don`t scale the bottle via translates I use the morphs but the cylinder doesn`t change, so is it possible in some way to connect the translates of the cylinder (x/y/z) with the morphs of the bottle?

Comments

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

    Yes, but you need to use a script to set it up.

  • cosmo71cosmo71 Posts: 3,609
    edited December 1969

    Yes, but you need to use a script to set it up.

    okay, thanks first but...

    I am programming at work sometimes but not in scripts and in a different programing language, so I have no clue what I have to program or how such a script should look like :blank:

  • Richard HaseltineRichard Haseltine Posts: 101,102
    edited May 2012

    This assumes you pass two nodes, first the one you want to have the ERC-controlled property, then the one you ant to be the controller, each followed by the name of the property that you want to use as a string. Then type is the name of the ERC type from DzERCLink (see script docs), multiplier and addend are the numbers that adjust the link.

    function AddERCLink ( controlledNode , controlledChannel , 
                        controlNode , controlChannel , type , multiplier , addend ) {
        
        if ( controlNode && controlledNode ) {
     // Get the master control
     var masterProperty = null;
     masterProperty = findMorphProperty( controlNode , controlChannel );
        
     // Get the slave control
     var slaveProperty = null;
     slaveProperty = findMorphProperty( controlledNode , controlledChannel );
     
     if ( masterProperty && slaveProperty ) {
         var ERCLink = new DzERCLink( type , multiplier , addend );
         if ( ERCLink ) {
      ERCLink.setProperty( masterProperty );
      slaveProperty.insertController( ERCLink );
         }
     }
        }
    }
    Post edited by Richard Haseltine on
  • cosmo71cosmo71 Posts: 3,609
    edited December 1969

    This assumes you pass two nodes, first the one you want to have the ERC-controlled property, then the one you ant to be the controller, each followed by the name of the property that you want to use as a string. Then type is the name of the ERC type from DzERCLink (see script docs), multiplier and addend are the numbers that adjust the link.

    function AddERCLink ( controlledNode , controlledChannel , 
                        controlNode , controlChannel , type , multiplier , addend ) {
        
        if ( controlNode && controlledNode ) {
     // Get the master control
     var masterProperty = null;
     masterProperty = findMorphProperty( controlNode , controlChannel );
        
     // Get the slave control
     var slaveProperty = null;
     slaveProperty = findMorphProperty( controlledNode , controlledChannel );
     
     if ( masterProperty && slaveProperty ) {
         var ERCLink = new DzERCLink( type , multiplier , addend );
         if ( ERCLink ) {
      ERCLink.setProperty( masterProperty );
      slaveProperty.insertController( ERCLink );
         }
     }
        }
    }

    but I do need to have a software or software update/plug in or something like that, right? it is not possible to write a script with the standard daz studio 3 or studio 4 pro version, right?

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

    Sorry, I tried replying earlier and the forum kept insisting I was logged out. If you are reading this it was more cooperative this time.

    No, you don't need a separate tool to write scripts - any text editor will do the job, though DS4.5 does have an integrated IDE again (and DS3 had an IDE and docs in the Scripting Development Kit).

  • cosmo71cosmo71 Posts: 3,609
    edited December 1969

    Sorry, I tried replying earlier and the forum kept insisting I was logged out. If you are reading this it was more cooperative this time.

    No, you don't need a separate tool to write scripts - any text editor will do the job, though DS4.5 does have an integrated IDE again (and DS3 had an IDE and docs in the Scripting Development Kit).

    no problem ;-) it is nothing that can`t wait :)

    thanks for the help and I will try it and maybe I can get it work :)

Sign In or Register to comment.