Tue, May 28, 10:29 PM CDT

Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 May 28 9:10 pm)



Subject: Need help creating a Poser python script


MeshWorks ( ) posted Sat, 12 January 2019 at 6:56 PM · edited Sat, 18 May 2024 at 2:18 PM

I am trying to create a Poser directory icon that can open the users default browser to view an online product tutorial. I've been able to do this for Daz Studio and need one for Poser. If there is a way to do that using a pz2 file, all the better. Here's the page I am connecting to;

http://www.krown-products.net/meshworks/Products/Manuals/KPL-CobraMotorhome.html

Anyone be able to help me with this?


bagginsbill ( ) posted Wed, 16 January 2019 at 6:54 AM · edited Wed, 16 January 2019 at 6:55 AM

You will need to make two files - a .pz2 file and a .py file. They should be in the same folder.

I used the name KrownProducts.pz2 and KrownProducts.py - you can, of course, use any names you like but you'll need to pay attention to where the name of the .py file is used inside the .pz2 file and synchronize them.

In your .pz2 file, put this:

{
    version
    {
        number 6
    }
    runPythonScript "KrownProducts.py"
}

In your .py file, put this:

import webbrowser

url = "http://www.krown-products.net/meshworks/Products/Manuals/KPL-CobraMotorhome.html"
webbrowser.open(url)


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


MeshWorks ( ) posted Wed, 16 January 2019 at 6:44 PM

bagginsbill posted at 4:43PM Wed, 16 January 2019 - #4343701

You will need to make two files - a .pz2 file and a .py file. They should be in the same folder.

I used the name KrownProducts.pz2 and KrownProducts.py - you can, of course, use any names you like but you'll need to pay attention to where the name of the .py file is used inside the .pz2 file and synchronize them.

In your .pz2 file, put this:

{
  version
  {
      number 6
  }
  runPythonScript "KrownProducts.py"
}

In your .py file, put this:

import webbrowser

url = "http://www.krown-products.net/meshworks/Products/Manuals/KPL-CobraMotorhome.html"
webbrowser.open(url)

That's exactly what I was needing. Thank you so much bagginsbill !


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.