Fri, Nov 8, 4:47 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 08 8:41 am)



Subject: Need a method to assign a single material to an entire pz3


rjbourc ( ) posted Tue, 11 January 2005 at 11:36 AM · edited Thu, 07 November 2024 at 11:06 AM

Not really sure if this is a strange request. I'm playing with some new toon shaders by sixus1, and it would be really nice to be able to assign a single shader to every object (characters and props) in a scene. Does anyone know of a Python script or (too much to hope for) some sweet keystroke sequence to do this? Any hints on how to write a script to do this? Any help would be appreciated. Thanks.


operaguy ( ) posted Tue, 11 January 2005 at 12:25 PM

I am marking to hear this answer. Also, I find I sometimes have to go in and REMOVE a texture from perhaps 16 shaders on differnt parts of the head of a character. Also would love to be able to clean out a part, such as a character's head, of either/or all attached textures and bumps and other maps, plus the shaders themselves, right down to the roots. Is there a tool for that? Thanks, hope it's okay I am piggybacking rjbourc. ::::: Opera :::::


Fugazi1968 ( ) posted Tue, 11 January 2005 at 3:19 PM

Attached Link: http://hometown.aol.com/visualranger/eg-tut.html

Not 100% sure if this will help you or not but it's something I did last weekend, whenI was turnign V3 into a marble statue. I posed her in Poser, then exported her as an obj file. Opened the obj file in UVMapper and selected everything. Clicked on Tools, Assign To - Material and entered a new name (stone in my case). Then resaved the model to a new name. Then in Poser imported the new uvmapped model back in. Because I assigned the whole model to one materail group uvmapper deleted the others, so I could assign one shader to the figure. In your case it should work as well, but when you export your have to export the whole scene. Oh and to save teh model you'll need UVMapper Pro (which I wouldn't be without). I hope that helps :) or at least gives you an idea or two. Take care John. Oh opera, you could do the same thing I think, with a bit more fine tuning to preserve the material areas you wanted to. Then point your figure or prop file to the new geomotry file(being carefull to take backups of course :)). The link shows you how to replace internal geomotry with an external file, which you may not want to do, but it should give you an idea of what you need to change to point to your new geomotry file. Hope that makes sense :).

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D


rjbourc ( ) posted Tue, 11 January 2005 at 5:44 PM

Fugazi1968: That sounds like a pretty workable solution, except I'm on a Mac, and thus no UVMapper Pro. It sounds like Material Manager over at Daz might be another solution, but again not for me. Thanks.


EnglishBob ( ) posted Wed, 12 January 2005 at 5:46 AM

You can do it with UVMapper Classic, unless the Mac version is very different from the Windows one. You don't even have to assign materials - just uncheck the 'Export Materials' option when saving the model. Your OBJ will then have no material definitions, and Poser will assign everything to the default material. You could even do it with a text editor. :) Go through the OBJ and delete every line that starts with 'usemtl'.


rjbourc ( ) posted Wed, 12 January 2005 at 6:29 AM

EnglishBob: I'll give it a try today. I've been trying to write a Python script to clean out the pz3, but I'm struggling with getting rid of the shadertree. I'm not much of a "search-and-replace" programmer.


an0malaus ( ) posted Thu, 13 January 2005 at 10:00 AM

Removing the shader tree for a material is both as simple and as difficult as loading a MAT pose file. I have a script which creates a MAT pose file for all the materials of a selected figure then applies it. As with loading an MT5 file in the material room, loading a MAT pose will completely replace the existing shader tree. This could easily be extended to process all figures and visible, non-light prop actors in a scene. In most cases this will work well, but if any figure has a complex shader node setup, a la Real Skin Shader, Poser 5 (at least on the Mac) shows the holes in its garbage collection and memory management routines with a very nasty tendency to crash. When my P5 is free from rendering tomorrow, I'll hack up the script and post it here. I would advise saving your scene before running the script, though.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


operaguy ( ) posted Thu, 13 January 2005 at 10:10 AM

That's more the type thing I was hoping for, myself. Thanks gwhicks ::::: Opera :::::


rreynolds ( ) posted Thu, 13 January 2005 at 2:31 PM

Same thing can be accomplished with the Grouping Tool in Poser if a whole object is to be given a single material. Click the Tool Click New Group and type a new name Click Add All Click Assign Material type in a name Click any other tool to get out of the Grouping Tool and the new material name will show up when the texture needs to be applied. This doesn't require exporting and importing objects. If the item already has various group settings, they can be added to the new group one by one, but there isn't away to select multiple groups at once.


rjbourc ( ) posted Fri, 14 January 2005 at 9:28 PM

gwhicks: I'd love to try your script. I'm interested in how you cycle through all of the figures and propes in a scene. I have cobbled together a script, based on published scripts by Ockham and Netherworks, which will overwrite an entire figure with a hardcoded material. But, like you said, Poser 5 Mac is pretty flaky. Two fields in the shaderNodes section don't overwrite properly (easily fixed by a search & replace in a text editor), and if I try to do two consecutive figures without reinitializing Python - whamo, major Poser crash. But still, it beats changing every single material one at a time. When I get this thing a little more stable, I'll be sure to post it.

rreynolds: I'll try the Grouping Tool approach tomorrow when my P5 gets finished rendering. Thanks.


an0malaus ( ) posted Sat, 15 January 2005 at 5:18 AM

OK, finally, here's the script ClearAllMaterials.py. The caveats are as follows: # This script will clear all of the materials for each figure in the scene. # It will also clear materials for props parented to a figure. # At this time Poser 5 does not support applying MAT poses to unparented props. # Some future revision may temporarily parent props to overcome this. # # NOTE: the test for whether a Body Part has a separate list of materials is # only cursory and not definitive. It is assumed that if the Body Part has the # same number of materials as the parent figure, it is the same list. This may # not be the case, but is the simplest way I could find to distinguish # inherited materials from those belonging only to that body part.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus ( ) posted Sat, 15 January 2005 at 5:28 AM

Additionally, the script applies one MAT pose at a time to each material which may appear to take an inordinately long time, but prevents crashes on the Mac which occur in complex scenes with large numbers of materials and shader nodes if all of a figure's materials are overridden at once by one MAT pose application. The script also sets the P4 materials (though they're overridden by the MAT pose application) as a further means of visual feedback on progress. That part could work sufficiently well on unparented props as long as they don't have any shader nodes defined (If you've never looked at them in the Material Room, for instance). If you like, you can uncomment the section which deals with unparented props and try it out. If anyone's interested in helping to deal with temporarily parenting props to allow MAT pose application, I need a dummy figure CR2 file that can be loaded into the scene, have the unparented props temporarily parented to it, then be deleted once the props have had their MAT pose applied and been unparented.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


EnglishBob ( ) posted Sat, 15 January 2005 at 4:17 PM

I think you need MinFig by lesbentley, from a free stuff not too far away...


an0malaus ( ) posted Sat, 15 January 2005 at 11:53 PM

Thanks EnglishBob. Got MinFig (thanks to Les Bentley BTW), have a nice bit of script for parenting the top level orphans to the new figure (CR2 file created and loaded by the script on the fly), preserving any prop heirarchy they might have below them. BUT, the internal names of the props do not receive the expected :# suffix indicating they are parented, though they obviously appear and act so in the interim heirarchy before I orphan them again. This appears to restrict the ability of the MAT Pose from modifying their materials list. I've tried manually adding the figure number suffix to the prop name in the MAT file, but it makes no difference, the pose doesn't take and there's no Python interface to allow the prop's internal name to be modified. Short, that is, of saving the scene file, changing the prop reference to actor and reloading, but then you might as well save the scene and clear the materials directly in the scene file before reverting the document. Ah well, there's usually only the GROUND prop unparented in the default scene and any prop loaded later and manually parented to ... [THINKS]... [HACKS] [TESTS] [SUCCEEDS - like a budgie with no beak] We have a Winner!!! If the MAT Pose file uses the keyword actor, rather than prop, it can be applied to unparented scene props like GROUND, YAY!!! Attached is ClearAllMaterials1.3.py which successfully clears all figure materials and parented or unparented prop or actor materials. No props or actors had their parentage modified (though it was questioned ;-)) during the running of this script. Enjoy, and post here if you do have any problems with it.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


rjbourc ( ) posted Thu, 20 January 2005 at 9:31 PM

gwhicks: I've got to tell you, your ClearAllMaterials code rocks. It has worked perfectly for me for the last three days of thrashing. Not a single crash, not a single material messed up. Thank you so much.


an0malaus ( ) posted Thu, 20 January 2005 at 10:41 PM

You're welcom rjbourc. I'm about to head off on vacation for 2 weeks and won't be online at all, so I'm happy you're not left hanging :-)



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus ( ) posted Wed, 23 February 2005 at 6:03 AM

file_167412.jpg

Hi all and thanks to nukem for reminding me I hadn't posted this till now. A new version of ClearAllMaterials1.5.py is once again available. This version is functionally identical but more streamlined than prior ones. Please DELETE all previous versions you may have downloaded... I'm off to Dunedin, New Zealand in the morning to attend a friend's wedding, so I may not respond till next Tuesday. Cheers, GeoffIX



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


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.