DAZ Script (DS4) - Identifying the node that's just been loaded

3dcheapskate3dcheapskate Posts: 2,719
edited December 1969 in Daz Script Developer Discussion

So I've managed to get my Prop Asset DUF to automatically run my DSA script after the prop's loaded...

...but how can I identify the prop that's just been loaded?

I need to select it so I can do stuff with it in my script, but:
- there doesn't seem to be any parameter in the DUF to set the prop as 'selected'.
- there isn't (as far as I can tell) any guaranteed way to identify the node that's just been added (the highest index seems to work, but after you've deleted a few items... ?)

Advice please?

(This is a follow on to "Can I automatically run a DSA script when I load a prop from a DUF/DSF file?")

Comments

  • macleanmaclean Posts: 2,438
    edited December 1969

    A correction and a piece of advice.

    In the other thread, you mentioned you used 'maclean's ‘collectNodes()’. The script isn't mine. It was written for me by Richard Haseltine. (Not that you could possibly have known this, but I don't want to steal the credit from Richard).

    That leads me to my advice. Over the years, I've had a lot of special requirements in scripting. For example, loading a figure with multiple props with same-name materials, but different textures. Or loading multiple parented figures with same-name materials. And so on. I've paid Richard to figure it all out for me, and it's been worth it. He always comes up with a solution.

    So if you're really stuck, contact him and see what he says. Paying someone to deal with the hassle leaves you more time to concentrate on the product, so I reckon it's worth the money.

    mac

    PS This is no reflection on your scripting ability. You obviously know a lot more than I do.

  • Richard HaseltineRichard Haseltine Posts: 100,939
    edited December 1969

    Node.select( true ) makes Node selected (and Node.select( False ) deselects ). I don't know a guaranteed way to identify the most recent node, however.

  • Richard HaseltineRichard Haseltine Posts: 100,939
    edited December 1969

    Ah, I see Rob did tell you how to get the new node in your other thread.

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited December 1969

    maclean said:
    A correction and a piece of advice.

    In the other thread, you mentioned you used 'maclean's ‘collectNodes()’. The script isn't mine. It was written for me by Richard Haseltine. (Not that you could possibly have known this, but I don't want to steal the credit from Richard).

    That leads me to my advice. Over the years, I've had a lot of special requirements in scripting. For example, loading a figure with multiple props with same-name materials, but different textures. Or loading multiple parented figures with same-name materials. And so on. I've paid Richard to figure it all out for me, and it's been worth it. He always comes up with a solution.

    So if you're really stuck, contact him and see what he says. Paying someone to deal with the hassle leaves you more time to concentrate on the product, so I reckon it's worth the money.

    mac

    PS This is no reflection on your scripting ability. You obviously know a lot more than I do.

    Thanks for the clarification. I'd planned to include a link to the collectNodes() script - it's one of the most useful pieces of DAZ script I've seen, and I use it in all my stuff (but apparently with the wrong accreditation - I guess it should be the 'maclean/Haseltine alternate collectNodes()' ;-) ). But the original thread's in the old forum archive (I think?) and I'm having major problems accessing that.

    As far as the time/money equation goes I have copious amounts of the former and precious little of the latter. And I actually rather enjoy trying to work things out for myself - although I often run into brick walls and need to post here and other places to get round them. And my products are all freebies (although if I come up with the right idea I may jump that fence), so there'd be no chance of recouping any initial outlay.

    And finally - I'm a self-confessed 'rusty programmer'. I can easily knock together something that works, which is good enough for me. But it's the software equivalent of a piece of veroboard with a sphagetti of wires and components dangling off it, and I can never be bothered to convert that into a proper production item.

    Node.select( true ) makes Node selected (and Node.select( False ) deselects ). I don't know a guaranteed way to identify the most recent node, however.

    Ah, I see Rob did tell you how to get the new node in your other thread. Thanks Richard - it's the guaranteed identification of the most recent node that's the main issue. I'm just going to give Rob's script a go.
  • macleanmaclean Posts: 2,438
    edited May 2014

    If you can figure it out yourself, all the better. I'd love to dedicate time to learning scripting, but making content is a full-time occupation, and to be honest, something in my brain doesn't really 'get' code. I wish it did.

    Hope you get it worked out.

    mac

    PS The other day, I happened to be reading up on POVRay and was fascinated to discover that it doesn't use geometry like other 3d programs. You write code for all the objects, cameras, lights, etc. Quite amazing really.

    Post edited by maclean on
  • FeronautFeronaut Posts: 1

    3dcheapskate said:


    Ah, I see Rob did tell you how to get the new node in your other thread.

    Thanks Richard - it's the guaranteed identification of the most recent node that's the main issue. I'm just going to give Rob's script a go.

    I'm glad you guys found a solution. In forums it is useful to mention the solution you have found so that others can benefit from it.

Sign In or Register to comment.