Fri, Nov 22, 7:40 AM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Can python detect new scene?


Netherworks ( ) posted Fri, 11 March 2011 at 4:52 AM · edited Fri, 22 November 2024 at 7:25 AM

Hey guys,

Is there any way for Python (or wxPython) to detect if a new scene has been started?  While the script has been running?

.


semidieu ( ) posted Fri, 11 March 2011 at 6:53 AM

I don't think directly. Don't know what kind of 'callbacks' it does return when a new scene is created. You will have to use alternate way to know if a scene has been created...


PhilC ( ) posted Fri, 11 March 2011 at 10:02 AM

Try a little skulduggery :)

Have your script change the GROUND xScale by a very small amount then continually check the xScale value. If it ever returns 100% you'll know that you have a new scene.


semidieu ( ) posted Fri, 11 March 2011 at 10:20 AM

Personnaly, I'm using the 'UNIVERSE' actor to add a new parameter.


Netherworks ( ) posted Fri, 11 March 2011 at 1:16 PM

Thanks Phil and Semi for your help.  Before attempting this, I decided to try something else to solve the problem I'm having.

I never explained the problem...

I was attempting to use Poser Python's Callback function and it goes absolutely bonkers on a new scene, if the current script isn't closed.  I'm supposing because you initially connect the Callback to something and I used the current scene.  I was going to use one of your detection tricks to Clear the Callback and restart it.  In my opinion, the whole callback thing is very volatile for scripts that can be kept running (this is a dockable panel)

Found a better solution.  Instead of using Poser's callback, use a wxPython Timer.  I have it at an 1000 ms loop but I think that a tad slow of a check so I'm going to reduce it to 250 ms.  That should be responsive enough to check the currently selected object.

So yeah, this was a serious DUH moment for me.

.


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.