Forum: Poser Python Scripting


Subject: Scripting forum still totally broken.

HartyBart opened this issue on Oct 01, 2021 ยท 23 posts


HartyBart posted Fri, 01 October 2021 at 5:30 AM


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 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 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

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 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

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

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

Cut code from Notepad++, screenshot below:



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


...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)


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 (also available in DAZ and HiveWire3D flavours) 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.




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

Using Notepad++, cut:


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.



The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) 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.




3dcheapskate posted 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 (also available in DAZ and HiveWire3D flavours) 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.




3dcheapskate posted Thu, 12 May 2022 at 4:18 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 (also available in DAZ and HiveWire3D flavours) 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.




3dcheapskate posted 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 (also available in DAZ and HiveWire3D flavours) 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.




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 (also available in DAZ and HiveWire3D flavours) 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.




3dcheapskate posted Thu, 12 May 2022 at 6:44 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 (also available in DAZ and HiveWire3D flavours) 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.




structure posted Thu, 12 May 2022 at 7:40 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

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 (also available in DAZ and HiveWire3D flavours) 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.




3dcheapskate posted Thu, 12 May 2022 at 10:34 AM

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


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



The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) 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.