Sun, Oct 6, 6:51 AM CDT

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Oct 05 8:40 pm)



Subject: Python script: hide everything BUT??


sandmarine ( ) posted Thu, 26 July 2007 at 11:00 AM · edited Fri, 27 September 2024 at 3:47 AM

Poser 6 has an option to Show All Figures, which is very practical when you have hidden all figures in your scene... but it doesn't have a Hide All Figures option in return.

What would make my life less of a nightmare would be a Python script where, if I have 7 figures on a scene, I click on one of them, and then run the script "Hide all figures, except for the selected figure"...  I just recently realized that if you hide all figures and leave on only the one you're rendering, the render time speeds up like crazy, but hiding all figures one by one is so time consuming, that it defeats the time saving purpose of doing precisely that all together.

so, does anyone if such a script exists?? if not, any ideas  on how to hide figures by the bulk, and not just one by one??

I'll really appreciate any input in this, as it's seriously driving me crazy...


SamTherapy ( ) posted Thu, 26 July 2007 at 11:06 AM

Not heard of one but I have to ask, why is it so time consuming to hide them all?  Just make them invisible by "Body" in the Hierarchy window.

Coppula eam se non posit acceptera jocularum.

My Store

My Gallery


stormchaser ( ) posted Thu, 26 July 2007 at 11:12 AM

I think it would make it easier if all figures in a scene could be made invisible with one click. Some characters can have a few items of clothing on them & they would need to be hidden individually.



sandmarine ( ) posted Thu, 26 July 2007 at 11:45 AM

I'm low on RAM memory, so even going to the hierarchy window slows things up like bad traffic...  and I agree with stormchaser, you have a one click to show all figures, it would be a killer if we had a one click to hide all of them...

thanks for the input already!! I'll keep checking on this issue


SamTherapy ( ) posted Thu, 26 July 2007 at 11:50 AM

Yeah, I never thought of that.  Doh.

Coppula eam se non posit acceptera jocularum.

My Store

My Gallery


LostinSpaceman ( ) posted Thu, 26 July 2007 at 12:11 PM

That's definately one for my wish list! I know you can hide all clothing articles on a figure by simply parenting them to the figure and then hiding the figure which does speed some things up, but a 1-click option would still be great to have as well.


ockham ( ) posted Thu, 26 July 2007 at 12:51 PM
stormchaser ( ) posted Thu, 26 July 2007 at 12:55 PM

Many thanks ockham, I should have known there'd be a script out there!



sandmarine ( ) posted Thu, 26 July 2007 at 1:15 PM

ockham, of course, the python script master!! should have known to contact you directly in the first place...

tons of way too many thanks!


sandmarine ( ) posted Thu, 26 July 2007 at 1:33 PM

ah, it was definately an awesome script, but it didn't really do what I was looking for... still pretty nifty, though...

I set up a spaship interior with 39 figures (and not counting the props most of those figures have)... so my ideal would be, say, clicking on one wall that I want to render, close up on it, then click on the "hide all figures and props except for the figure selected and its props" and then wham! all 38 figures would hide and presto...

thanks again, of course... I'll keep checking on this


destro75 ( ) posted Thu, 26 July 2007 at 3:03 PM

Quote - ah, it was definately an awesome script, but it didn't really do what I was looking for... still pretty nifty, though...

I set up a spaship interior with 39 figures (and not counting the props most of those figures have)... so my ideal would be, say, clicking on one wall that I want to render, close up on it, then click on the "hide all figures and props except for the figure selected and its props" and then wham! all 38 figures would hide and presto...

thanks again, of course... I'll keep checking on this

I understand exactly what you're looking for. I tried to sit down and write this script once before. However, the issue is being able to cycle through everything in the scene.

Poser makes it easy to work with the currently selected actor (figure/prop.) Trying to cycle through each individual actor in the scene gets a bit tricky. You can cycle through the actors (or better yet, the figures,) method of the scene, then cycle through that actor's children perhaps? (Would that give you the props associated with the current actor?)

I don't know how this would work in the end though. There is a SetOnOff method for figures, but not for actors. I think that's where I hit a snag in the past. (Honestly, it's been about a year since I attempted this script, so I really don't remember.)


ockham ( ) posted Thu, 26 July 2007 at 3:28 PM

"hide all figures and props except for the figure selected and its props"

I'll write a variation that does this.   Destro is right that locating all attached
props can be tricky, especially things like hair.  For some reason Poser
is inconsistent in deciding who belongs to whom, and I've never pinned 
down exactly where the inconsistency is.

My python page
My ShareCG freebies


Miss Nancy ( ) posted Thu, 26 July 2007 at 3:54 PM

o.k., thx fr working on the script, ockham. keep us posted on yer progress.



stormchaser ( ) posted Thu, 26 July 2007 at 4:04 PM

Much appreciated ockham, I think alot of people would find this very useful.



ockham ( ) posted Thu, 26 July 2007 at 4:09 PM

Attached Link: http://ockhamsbungalow.com/Python/HideAllBut.zip

Okay, same ZIP, new content.  As predicted, this was not quite as simple as the other forms.  I also gave each script in the ZIP a longer and more descriptive name, and an internal comment explaining what it's for.

My python page
My ShareCG freebies


stormchaser ( ) posted Thu, 26 July 2007 at 4:18 PM

Nice one ockham. I'll have to try it tomorrow as I can't get at Poser 'till then. Many thanks.



sandmarine ( ) posted Thu, 26 July 2007 at 8:50 PM

checking it out right now, ockham, thanks so much for all your effort!! and thanks everyone else for the interest and Input! I'll post back later with reports on how it all went

thanks once more!!


sandmarine ( ) posted Thu, 26 July 2007 at 9:39 PM

hmmm, it appears to be the very same ZIP as the rpevious one... both files inside have the same modified date, and they do exactly the same as they did before... and the names inside the zip are exactly the same and not longer...

maybe I have the file cached in my system?? I refreshed everything and dnloaded it with a different name., but keep getting the same files over and over...


destro75 ( ) posted Thu, 26 July 2007 at 9:44 PM

Great work Ockham. "HideAllButThisFigureAndAttached.py" is the base of the script I was once trying to write. The only addition I wanted to make is to cycle through each figure/prop in the scene, and render each as the only visible object, one at a time. Sort of a Render Passes script, but not dealing with lights.

If I have some spare time, I'll work on modifying the script to do this. (If you don't mind of course.) No promises though, all.


destro75 ( ) posted Thu, 26 July 2007 at 9:46 PM

Quote - hmmm, it appears to be the very same ZIP as the rpevious one... both files inside have the same modified date, and they do exactly the same as they did before... and the names inside the zip are exactly the same and not longer...

maybe I have the file cached in my system?? I refreshed everything and dnloaded it with a different name., but keep getting the same files over and over...

 

It shouldn't be. I downloaded it, and it's different for me. There should be 3 files in the zip instead of 2.


ockham ( ) posted Thu, 26 July 2007 at 9:48 PM

Ack!  My stupid website caches things, and I thought I had killed the
cache.  I'll upload a HideAllBut2.zip............

Okay, try this.  The old one is firmly deleted and the new one
is definitely the new one.

http://ockhamsbungalow.com/Python/HideAllBut2.zip

My python page
My ShareCG freebies


sandmarine ( ) posted Thu, 26 July 2007 at 9:55 PM

YOHEEEEEEEEEEEEEEEEEEEEE!!! (yeah, my onomatopeias are weird, I know)

Thank you so much, ockham!! this new file absolutely and completely delivers, you have proved to be once more the true one and only python script master!!

thanks again for letting me keep my sanity, this whole  issue was truly drving me nuts...


ockham ( ) posted Thu, 26 July 2007 at 9:56 PM

The cycle-and-render would look like this.  (Attaching directly if possible)

My python page
My ShareCG freebies


ockham ( ) posted Thu, 26 July 2007 at 9:57 PM · edited Thu, 26 July 2007 at 10:01 PM

file_383984.jpg

Nope, attaching directly didn't work.   Didn't think it would, but hoped Rendo might have fixed their attachments in the latest forum revision.

Here's an image of the file.

The part above "AlreadyUsed=[] " is new, and the last line is new.
Everything between those points is the same.

My python page
My ShareCG freebies


destro75 ( ) posted Thu, 26 July 2007 at 10:16 PM

file_383988.txt

Nice work, once again Ockham. Guess I don't need to worry about putting in the time after all. I just copied the text into a file. Like you said, you can't directly post a .py file, however, if you change the extension to .txt, you can upload it to the thread.

I've copied the text and attached it to this post. If someone downloads it, make sure you change the .txt extension to .py

Thanks Ockham!


ockham ( ) posted Thu, 26 July 2007 at 10:18 PM
sandmarine ( ) posted Thu, 26 July 2007 at 11:55 PM

destro, I got this error with your script:

  File "", line 30
    scene.Render()
                ^
SyntaxError: invalid synta

and ockham, after I apply your script, as I originally wanted, all figures but the selected one hide away... but now, after I render the one figure and I want all other 38 figures to reappear, when I click on the poser menu Show All Figures, only the figures parented to the one figure show up, all other figures remain hidden even after that command is applied... hence, i have to go to the hierarchy editor and make them show up one by one... pretty much completely defeating the original time saving purpose...

is there any work around this?? thanks again for everything


ockham ( ) posted Thu, 26 July 2007 at 11:59 PM

Probably the quickest way to make everything show up again is just
to Revert the PZ3.  (Providing you saved it frequently!)

I'll rewrite the script so that it forces both hide and unhide,
which should make the multi-render work better, and add
a mirror-image script to reverse the action.

My python page
My ShareCG freebies


sandmarine ( ) posted Fri, 27 July 2007 at 12:11 AM

thanks so much again for all your work... I'll stick to reverting to the original PZ3 for the time being...


destro75 ( ) posted Fri, 27 July 2007 at 5:38 AM

file_384009.txt

> Quote - destro, I got this error with your script: > >   File "", line 30 >     scene.Render() >                 ^ > SyntaxError: invalid synta > > and ockham, after I apply your script, as I originally wanted, all figures but the selected one hide away... but now, after I render the one figure and I want all other 38 figures to reappear, when I click on the poser menu Show All Figures, only the figures parented to the one figure show up, all other figures remain hidden even after that command is applied... hence, i have to go to the hierarchy editor and make them show up one by one... pretty much completely defeating the original time saving purpose... > > is there any work around this?? thanks again for everything

 

I'm not sure why you're getting an error there. The code is correct, as far as I can tell. I haven't run it yet, but it looks correct.

I'm attaching another version. It will process each render seperately, and save them to C:Poser_Renders, and inside that folder, there will be folders with the time the script is started. Inside any of those folders will be a number of rendered images, based on the processing of this script. (Sorry, I don't have time to test this, and I'm on my way to work, but this should work okay.)


sandmarine ( ) posted Fri, 27 July 2007 at 12:50 PM

will check on it then... tons of thanks!


nruddock ( ) posted Fri, 27 July 2007 at 12:56 PM

Quote - I'm not sure why you're getting an error there. The code is correct, as far as I can tell. I haven't run it yet, but it looks correct.

An old favourite, you have to remember to press return at the end of the last line of code, otherwise you get this suprious "Syntax Error" report.


destro75 ( ) posted Fri, 27 July 2007 at 1:48 PM

Quote - > Quote - I'm not sure why you're getting an error there. The code is correct, as far as I can tell. I haven't run it yet, but it looks correct.

An old favourite, you have to remember to press return at the end of the last line of code, otherwise you get this suprious "Syntax Error" report.

DOH! Yes, you're right! I totally forgot about that. It's obviously been quite a while since the last time I wrote some Python code. 😊


sandmarine ( ) posted Sun, 29 July 2007 at 8:35 PM

destro, I still dont quite get what your script is supposed to do...

:/


destro75 ( ) posted Mon, 30 July 2007 at 4:42 AM

Quote - destro, I still dont quite get what your script is supposed to do...

:/

It should basically do what Ockham's version did, with the additional bonus of cycling through the scene, turning off visibility for each figure but one, then rendering and saving that image.

You should find a folder on your C: drive named Poser_Renders, and inside that folder, should be a bunch of folders. Inside those folders should be a bunch of images, which would be the renders.

Honestly, I have no idea whether the script actually works or not, since I never ran it. I wrote it at work, so it may have no functionality at all.


sandmarine ( ) posted Tue, 31 July 2007 at 4:21 PM

interesting concept to grasp... certainly not what I was aiming at, but interesting nonetheless...

I'm still using ockham's script, with the on;y draw back of constantly having to close my poser scene without saving.... as once all figures are hidden, they dont come back with the "show all figures" poser command... but it's a beginning...

thanks again for all the help!


Gini ( ) posted Wed, 01 August 2007 at 8:12 AM · edited Wed, 01 August 2007 at 8:13 AM

Attached Link: Masons free stuff

@sandmarine- try the 3rd one here on Masons page too.

" Try and be nice to people, avoid eating fat, read a good book every now and then, get some walking in, and try and live together in peace and harmony with people of all creeds and nations."
-Monty Python


sandmarine ( ) posted Fri, 03 August 2007 at 3:05 AM

ahh, thank you so much!! this definately helps, and a lot!!

thanks again


sandmarine ( ) posted Tue, 07 August 2007 at 5:42 AM

ockham, any news on your reversal script?? mason's script is useful, but it doesn't work for a scene with too many figures (it clips at certain point and the window cannot be scrolled nor columned)

thanks again for all your help!


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.