Adding to Cart…
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.You currently have no notifications.
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.
Comments
Glad to be of service.
I haven't had a chance to test these yet but I should be doing so tomorrow.
Well I finally got around to testing this and it works great, both do, thank you. All went without a hitch but for one minor issue, the surfaces don't appear in the surfaces pane selected. To show them in the surfaces pane one has to select the node in the scene pane. But I did want to avoid that which was the main basis for the script. Would/is there a way for them to show up in the surfaces pane after the script has run? I must stress that it will do if the last question isn't possible as it serves part of the purpose but it would be nice for customers to have them showing in the surfaces pane automatically for fine tuning.
I guess it would be possible to select the corresponding node when the surface gets selected. I think that would do it. I can't think of any other way off the top of my head.
The Surface pane option menu - lined button in the top corner or right-click the tab - should give three show options, one of which is everything; select that.
Yeah that should work as when all the nodes were selected manually after the script had been run, the surfaces were expanded and all surfaces with that tag or name were available for editing so with what you have said above that sounds like what is needed.
I do realize though that by doing so I am restricting the script by constraining it to look for just one common node name but in some circumstances that will be perfect. But they are both still usable for just applying an Emissive light preset so for that they work great.
Can I be cheeky, if does take to much of your time, and have a script to just select named nodes by themselves. Saying no isn't as issue for me at all. Ast my old pa used to say "you don't get anything without asking".That way I could do all the jobs needed. The tagged script could be used to load a mat preset across different named nodes and surfaces and the node script to select a portion of those multiple named nodes. In some cases the customer might want adjust a section of lighting and leave the others alone, in their preset default state. It's all about ease of selecting a lot of surfaces or nodes quickly.
yeah they will only show up with "Display All Itens". The other two don't show any nodes when the script has been run. I should have added that as I did test that, thanks Richard.
I'm not sure what you mean. Do you mean select by tag for selected nodes? If so, I already have that written, but need to test it more.
You do realize that the Select By Tag sample I posted already handles node selection, correct? It even provides options for whether or not to synchronize node and/or surface selection; i.e. whether or not to drop selection of nodes and/or surfaces that do not have the specified tag.
-Rob
Yes, I am aware. I produced a simpler script that did only one job.
Well some surfaces have the same settings which can be across different named nodes. I was assuming you can't do multiple nodes if the names are different. To clarify. Some light bulbs can be spread over different nodes that have different names. So if I am right about the last sentence in this reply then I would need a script that just selects nodes of the same name, period.
Rob if that was aimed at me then it fell of deaf eyes as I have no idea what I am looking at or which to choose. :) But thanks for popping in.
Rob and I both have scripts with the ability to select by any criteria you would like. The script can select all materials with a particular tag across the entire scene, or it can select only the materials with a tag from selected node(s). I've been testing against i13 Modern Loft since it has heirarchies of both nodes and surfaces. What I wanted to be able to do is select all the "Emissive" materials in a given part of the loft.
I assume you still want to select by tag. I believe that's more appropriate than selecting by name. That way (using the lighting example) the surface name can be "flame," "filament," or "tube," while the material is tagged "Emissive," or "Light."
This script traverses the heirarchy of the currently selected nodes and selects all the surfaces with the specificied tag. It also selects the node for the newly selected surface such that the selections are displayed properly in he surface pane.
If you start off with the scene selected like this,
then run the script, you end up with your scene like this,
and your surfaces tab like this.
Is this what you're after, or something else?
Sorry been watching the Rugby World Cup.
Yeah from what I can make out I would say that is what I would like very much. Just so we are on the same page the last scripts didn't need anything selected in the scene before hand I assume this will still be the case? if it is then YES your example is ideal.
OK, I've got two separate scripts:
SelectSurfacesByTag.dsa
SelectSurfaceByTagForNodes.dsa
The first selects all surfaces in the scene with a given tag. The second selects surfaces only from nodes (and their children) that are selected in the scene tab. Both of them display the selected surfaces in the surfaces tab when they're done.
Oh cool thank you I will give them a test and report back. I think the first one is more what I require as I don't really want to have to select anything in the scene prior to running the script. I appreciate this very much Esemwy.
Esemwy thank you for you efforts that latest Tag script works a treat.
I needed a version of the seach-surface-by-name script in this thread. I didn't want to go through tags as I am thinking of converting "Urban Sprawl 2" by Stonemason over to Iray: http://www.daz3d.com/urban-sprawl-2-the-big-city
Many of the surfaces are named "WindowE", "WindowA", WindowE1" and all sorts of surfaces that are all the same texture but contain the keyword "Window" in their surface name. So I needed all partial matches. This script below is an edit of that original script in this thread to do a partial match. I just put it into the Script IDE window and hit execute to select all of the partial matches.
does anyone if I can merge this Clear Selection Script
with the Tag selection script so when the script is executed the script will clear whatever is selected prior and then select the surfaces with the given tag.
That'll clear your selected nodes, but not necessarily selected surfaces. I can gen up something this evening (GMT-5), when I get home, if you can wait. If you look at Rob's script above, the function getMaterialForStatic will get the first material, then you can get the selected materials and unselect them like you do with the nodes in hour example.
Like with all my requests for help there is never any rush. LOL
Esemwy that would be awesome. All I need is for the script to unselected any nodes that have been selected before engaging the Tag selection script. As I have it now the customer will have to run the Clear Selection script before running the tag selection script and I would like them both in one script if possible.
OK, I think this is what you need. I added an explicit unselect of all the nodes in the tag selection function. It was a one line change. This makes sure that only the nodes and surfaces of the current tag are selected.
If you want to unselect everything, this one will do the job.
The second one is entirely unnecessary if you're just going to run the first one afterward, but I thought it might be useful.
Personally I'm using :
For my use this is enough, I never needed more. But it does not unselect previously selected materials. Just the nodes.
Esemwy thanks again. I will test the first one out tonight. Yeah I don't think I will need the latter but I will keep it just in case.
The reason why I would like other nodes and surfaces deselected first is so when poeple use the script they have the right surfaces selected to be adjusted to thier desired taste. All without the need to Clear selection first which has no predifined shortcut. I made one myself for my UI.
Well Esemwy you nailed that. A big wam hearted thanks for that. Works perfectly and all the scripts have been updated. This will make it so easy to select hidden or obscured surface zones.
I realize that this is an old topic, but am curious if any of the scripts previously linked by Esemwy might possibly exist somewhere, please.
Am new to Daz scripting and was hoping to experiment with a script that looks through the surfaces of all objects in a scene, identifying which ones have Iray emissive nodes. These scripts sound like a good base from which to start.
I’ve got a script. It needs some work, but is generally useful for what you want.
Thank you Esemwy !
I stumbled upon this thread trying to figure out why DzMaterial.select(false) doesnt work?
It says isSelected() == false after a select(false) but still selected (I see that in the Surface tab while running the script. Must be a way to unselect the materials, from a script, as select(true) works, but looping through the matrial zones doing select (true) /* stuff */ select (false) just extends the selection.
Anyone solved this?
@Totte
I cannot reproduce. Does the following not work for you, or do I not understand what you are trying to do?