Forum: Poser Python Scripting


Subject: Calling "Remove Detached Nodes" Wacro in a Script

Iuvenis_Scriptor opened this issue on Mar 09, 2024 ยท 3 posts


Iuvenis_Scriptor posted Sat, 09 March 2024 at 12:11 AM

I'm trying to write a script that moves around a few node connections and automatically deletes any nodes orphaned by the process.  I've located the script called by the "Remove Detached Nodes" wacro button, but so far, I haven't been able to get the programmatic call to have any effect.


My code looks like this:


for material in materials:

      //do some stuff that's not relevant here

      clear = poser.AppLocation()+"\Runtime\Python\poserScripts\Wacros\removeOrphans.py"
      (poser.Scene()).SelectMaterial(material)
      poser.ExecFile(clear)



If anyone has any guidance as to what I'm doing wrong, I would greatly appreciate it.  Thanks in advance!


EVargas posted Sat, 09 March 2024 at 8:38 AM

Hi, try escaping or inverting the slashes, I tested your lines "clear" and "poser.Exec" here and changing to this made the script run for me, with message "please select a material":

"\\Runtime\\Python\\poserScripts\\Wacros\\removeOrphans.py"


EVargas.Art


Iuvenis_Scriptor posted Tue, 19 March 2024 at 1:03 PM

Escaping did the trick.  Thanks!