Wed, Nov 27, 4:52 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: Scripting forum still totally broken.


HartyBart ( ) posted Fri, 01 October 2021 at 5:30 AM · edited Wed, 27 November 2024 at 4:49 AM

QaUwxjLuyVLk3VNunY0dWnux0Svsj0q4Dlhx3GfC.jpg


This is all I see, with or without browser extensions running.



Learn the Secrets of Poser 11 and Line-art Filters.


structure ( ) posted Fri, 01 October 2021 at 4:55 PM
Forum Coordinator

That looks right

Locked Out


HartyBart ( ) posted Sat, 02 October 2021 at 7:14 AM

So where is the ability to add code?



Learn the Secrets of Poser 11 and Line-art Filters.


structure ( ) posted Sat, 02 October 2021 at 10:34 AM · edited Sat, 02 October 2021 at 10:35 AM
Forum Coordinator

you now use copy and paste

see the announcement at the top of this forum


Locked Out


HartyBart ( ) posted Sat, 02 October 2021 at 11:21 AM

Nope. I still don't see it. No kind of context-menu shows or is possible anywhere, like the other thread shows.



Learn the Secrets of Poser 11 and Line-art Filters.


structure ( ) posted Sat, 02 October 2021 at 11:36 AM
Forum Coordinator

copy your code, go to the forum

right click

paste as plain text

Locked Out


structure ( ) posted Mon, 04 October 2021 at 12:13 PM · edited Mon, 04 October 2021 at 12:13 PM
Forum Coordinator

If you are still having problems pasting code. There is a handy tool here...

Go to that page and paste your code in the left window,  at the top right of the page... select Preview As > markdown.

On the resulting page - copy the text and paste it in here. 


Locked Out


HartyBart ( ) posted Wed, 06 October 2021 at 2:32 PM · edited Wed, 06 October 2021 at 2:32 PM

No, I just tried it with some code on another thread. Copy from Visual Studio Code, right-click, paste as plain text. Doesn't work. It just pastes as.... plain text. Is the ability to paste a proper code-block gone forever?



Learn the Secrets of Poser 11 and Line-art Filters.


structure ( ) posted Wed, 06 October 2021 at 4:30 PM · edited Wed, 06 October 2021 at 4:36 PM
Forum Coordinator

I just tried a straight copy and paste and it worked fine 

def image_viewer( self ):

dialog = imagebrowser.ImageDialog( parent )   

if dialog.ShowModal() == wx.ID_OK:

print( "You Selected File: " + dialog.GetFile()  )

could be that are some hidden codes in VS that are stripped by the new editor

Locked Out


HartyBart ( ) posted Thu, 14 October 2021 at 5:49 AM · edited Thu, 14 October 2021 at 5:54 AM

Copy and pasting from a proper code editor now works, but not from Notepad++. Examples:

# Copy and Paste from Notepad++ with Language : Python set and colour-coding on. Indenting correct but colors lost and spacing off.

if figure:

    head_parts = figure.Actor("Head").Children()

    for target in head_parts:

        targetname = target.InternalName()

        if "Brow" not in targetname and ("Eye" in targetname or "eye" in targetname) :

            [then do something]

# Copy and Paste from Visual Code Studio. Indenting and colors correct.

if figure:
    head_parts = figure.Actor("Head").Children()
    for target in head_parts:
        targetname = target.InternalName()
        if "Brow" not in targetname and ("Eye" in targetname or "eye" in targetname) :
            [then do something]


Type something under where the code is to go, before pasting in the code (such as this line). Or else you will not be able to add a new normal blank line, and then type normally beneath the code block (as I'm doing now).



Learn the Secrets of Poser 11 and Line-art Filters.


structure ( ) posted Thu, 14 October 2021 at 7:10 AM
Forum Coordinator

yes it is nice. 
Shame we no longer have the preview button though. 

Locked Out


3dcheapskate ( ) posted Wed, 11 May 2022 at 10:31 PM · edited Wed, 11 May 2022 at 10:32 PM

12 May 2022 having the same problem. It appears to be due to EOL character(s)

Cut code from Notepad++, screenshot below:

BXiYjHLVILN4dsqeP8SRiHzaBEsd641zLJyf4VSu.png


In the Renderosity forum post edit box Right-click > Paste as plain text...

aWQvHdoMc24jWN9AfnP6DuPOz2DNiojSaJARTRkv.png


...and here's what I get...

# Comment line 1

# Comment line 2

# Comment line 3

# Comment line 4

# Comment line 5


(screenshot of what the paste as plain text looked like in the edit box below)

Vxd7vYsm6I8ULOg3qwuPDcQjBIV2LHc0cx4fqiod.png

I seem to get the same result when I paste into the edit box here regardless of whether I use CR-LF, just LF, or just CR as the EOL character in Notepad++, although I did find a bizarre workaround.


Just in case it's relevant I'm use Microsoft Edge


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



structure ( ) posted Wed, 11 May 2022 at 11:55 PM
Forum Coordinator

edge may well be your problem, it does have it's own idiosyncrasies. I would suggest that you try another browser. I have confirmed working in Chrome, Opera, Brave and Vivaldi. 

Locked Out


3dcheapskate ( ) posted Thu, 12 May 2022 at 3:42 AM · edited Thu, 12 May 2022 at 3:47 AM

Using Notepad++, cut:

mhqpoA1l0r7semHS8QrOyGwl3sVMn6YMMJoZdyrY.png


Using Vivaldi, right-click > Paste as plain text:

# Comment 1

# Comment 2

# Comment 3

# Comment 4

# Comment 5


That's the exact same problem. This is what I did.

DxOin9NXJ6NvQUlczPvwcB7KbdxEzJNVSR0lt7rA.png


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Thu, 12 May 2022 at 3:50 AM · edited Thu, 12 May 2022 at 3:50 AM

So Notepad++ is the one thing that me and HartyBart have in common, and he's already said that "Copy and pasting from a proper code editor now works, but not from Notepad++"

I don't use proper code editors. ;)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Thu, 12 May 2022 at 4:18 AM · edited Thu, 12 May 2022 at 4:23 AM

It appears to be the Renderosity forum software rather than Notepad++ that's at fault

DAZ forum handles cut-and-paste from Notepad++ fine - end of this post

Hivewire3D forum handles cut-and-paste from Notepad++ fine - this post

I haven't tried any others yet.

Renderosity forum ?

# EOL = CR-LF

# comment 1

# comment 2

# comment 3

# comment 4

# comment 5


# EOL = CR
# comment 1
# comment 2
# comment 3
# comment 4
# comment 5

# EOL = LF
# comment 1
# comment 2
# comment 3
# comment 4
# comment 5

(and before anybody suggests simply changing the EOL character(s) to either CR alone or LF alone before cutting-and-pasting to the Renderosity forum, it's not quite that simple - the behaviour seems to depend on what, if any, other EOL character(s) have been pasted into the post ! )


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Thu, 12 May 2022 at 4:27 AM · edited Thu, 12 May 2022 at 4:27 AM

I suppose there's no chance of you allowing us to attach text files to posts in this forum, like most other forums do, to get round this ?

;)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



adp001 ( ) posted Thu, 12 May 2022 at 5:48 AM

Look at the top of the page. It says:


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.




3dcheapskate ( ) posted Thu, 12 May 2022 at 6:44 AM

So it does !

I'll give that a try - there should be a text file attached to this post (although there's nothing in or around the edit box to indicate that the text file was successfully added)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Thu, 12 May 2022 at 6:44 AM · edited Thu, 12 May 2022 at 6:52 AM

Well that didn't work. I must have done something wrong. This is what I did.

Click the little 'Picture' icon above the edit box - an Insert Image box appears.

Click the 'Choose Files' button, select 'All files (*.*) from the drop down bottom right of the 'Open' dialog so text files show up, scroll down and select my text file, click 'Open'...

The 'Open' dialog  and 'Insert Image' box simply vanish 

(I did mention that I'm a professional idiot tester, didn't I ? If it's possible to do something wrong by following the instructions I'll do it...)

(I'm using Edge)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



structure ( ) posted Thu, 12 May 2022 at 7:40 AM · edited Thu, 12 May 2022 at 7:49 AM
Forum Coordinator

(note the edit box always skips a line too just with a normal enter keypress)

--------------------------------------------------

from Notepad++ 

cancelled = False


# test if command is valid

# if so run the script 

if command:

--------------------------------------------------

pasted fromN++ in edge

cancelled = False


# test if command is valid

# if so run the script 

if command:

--------------------------------------------------

from vscode :

cancelled = False

# test if command is valid
# if so run the script
if command:

--------------------------------------------------




Locked Out


3dcheapskate ( ) posted Thu, 12 May 2022 at 10:19 AM · edited Thu, 12 May 2022 at 10:27 AM

Typing text into edit box, line terminated by pressing the Enter key

More text, line terminated by pressing Shift-Enter
More text



The results of this test are exactly the same on the DAZ forum (i.e. Enter adds a blank line, Shift-Enter doesn't)

On the Hivewire3D forum neither Enter nor Shift-Enter add that spurious blank line.


If I cut-and-paste from any of the 3 forums (Renderosity, DAZ or Hivewire) and paste to Notepad++ the EOL character is the  CR-LF pair because I'm using Windows


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Thu, 12 May 2022 at 10:34 AM · edited Thu, 12 May 2022 at 10:35 AM

undefined posted at 5:30 AM Fri, 1 October 2021 - #2965901

QaUwxjLuyVLk3VNunY0dWnux0Svsj0q4Dlhx3GfC.jpg


This is all I see, with or without browser extensions running.

Same here (Edge) - it was middle button of the middle group (6th from left, 5th from right) that I used to try and attach a text file

n1DPDn7pyR6iv4BzNtGwcc6RlU5lOk0Af7WbBTjS.png


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



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.