Rename multiple selected surfaces in the Surface Editor...

lardbros

Not so newbie member
Please please please can I have the ability to multi-select surfaces in the surface editor, and right-click and rename them ALL... not just the one I happen to right-click on!

This drives me crazy! Having to rename 100 surfaces that have all been called the same due to the FBX importer being a bit crappy, not recognising that a material 'Metal' on one object isn't the same as 'Metal' on another, and calls it 'Metal01' instead... is completely unnecessary.

This should be really simple! Please, please, please either fix the FBX importer (loading into Modo first, and then exporting as an .lwo works fine, so Luxology know what they're doing!!!) or let me rename multiple selected surfaces!! PLEASE!!??

Thanks,
Tim
 

lertola2

skeptic
I am struggling with this issue now also. I think I remember that someone wrote a script to solve this problem. But I can't find the posts now. The stupid forum broken search function is apparently never going to be fixed.
 

inkpen3d

Member
At the top of the surface editor there's a drop-down menu "Edit by" where you can select either "Object" or "Scene". If you select "Scene" then all surfaces with the same name are grouped together into one entry in the "Surface Name" list. Select the given surface you want to rename and then use the "Rename" button in the top right of the panel to rename the surface. Save your model(s) and remember to return the "Edit by" back to "Object". This works the same in both Modeler and Layout.

Hope that helps.

Edit: Ah, sorry, misread your post. Ignore what I said as it won't help your particular problem.

Regards,
Peter
 
Last edited:

jeric_synergy

Axes grinder- Dongle #99
Just a red flag: is the "By Name" switch 'destructive', i.e. global and non-reversable? Just sayin' it might be well to step carefully with it.
 

inkpen3d

Member
Just a red flag: is the "By Name" switch 'destructive', i.e. global and non-reversable? Just sayin' it might be well to step carefully with it.

Agreed. Though it does pop up a warning when selected. However, as I said in my edit, I don't think that method will help with this particular problem. :(
 

lertola2

skeptic

I was very hopeful that one of those would solve this problem but neither does as far as i can tell. They both will let you rename surfaces by adding a prefix or suffix but they will not combine multiple surfaces into one. Lightwave's fbx exporter gives each object a different surface name by appending a number to it. So if you have 100 clones of a box, for example, and you want to combine them into one object by exporting an fbx file from Layout and opening it in Modeler then you end up with 100 different surfaces like box_1, box_2, box_3 etc. Maybe I am mis-remembering but I thought there was a thread recently where some one brought this up and someone else wrote a script to solve the problem.
 

iain_r

New member
Change surface for polygons

You can try these python scripts. They do the same but the file with mon in the name has monitor functions to display an update, makes it run slower.

You can also try this lscript if you wish, contains monitor as well.

Code:
@version 2.2
@warnings
@script modeler
@name "Change Surface"

main{

    reqbegin("Change Surface");
    reqsize(300,100);
    c1 = ctlstring("Surface to Replace", "");
    c2 = ctlstring("New Surface", "");
    return if !reqpost();
    osurf = getvalue(c1);
    nsurf = getvalue(c2);
    reqend();
    tokens = parse(",", osurf);
    nt = size(tokens);
    setsurface(nsurf);  // new surface
    surfObj = Surface(nsurf);
    surfObj.setValue(SURFCOLR, <118, 118, 118>); // just a colour for a basic window
    currSurf = nextsurface();
    s = 1;
    while(currSurf != nil){
        s = s + 1; 
        currSurf = nextsurface(currSurf);
        
    }
    moninit(s, "Processing Surfaces");
    currSurf = nextsurface();
    while(currSurf != nil){
        selmode(USER);
        selpolygon(SET, SURFACE, currSurf);
        for(i=1; i <= nt; i++){
            t2 = "^" + tokens[i];
            expr = regexp(t2);
            if(expr == nil)
                return;
            if(currSurf == expr){
                changesurface(nsurf);
            }
            monstep();
        }
        currSurf = nextsurface(currSurf);
        selpolygon(CLEAR);
    }
    monend();
}

Regards

Iain
 

Attachments

  • changesurface.zip
    2.2 KB · Views: 194

lertola2

skeptic
You can try these python scripts. They do the same but the file with mon in the name has monitor functions to display an update, makes it run slower.

You can also try this lscript if you wish, contains monitor as well.

...

Regards

Iain

Thanks Iain but none of those scripts seem to work. The Change Surface script is changing all polygons to the new surface, not just polygons that contain the search text in their surface name. The Enumerate Surface gives each selected polygon a unique surface name. And the script you pasted in the code box gives me a python error when I try to run it.
 

lardbros

Not so newbie member
I'm kind of glad that someone else has come across this pretty major issue with FBX. I've been on at Newtek for quite some time to sort this, and never got anywhere.

I have the exact same problems as you lertola. I want to select multiple surfaces (which have different names, like metal001, metal002... ...) and rename them to the same (metal, for instance).

I tried the plugin that is meant to help manage surfaces, but it has the same issue as the built in LW Surface Editor. You can multi-select surfaces, but as soon as click re-name it'll just do the surface underneath the mouse-click. VERY frustrating!



Think it's a bit of a case of people reading the initial problem, and thinking they understand it entirely. It's only when you attempt to load a complex FBX from 3dsMax that you realise how horrendous the material/surfaces are dealt with in LW :(
 

lardbros

Not so newbie member
Actually, while we're at it... can we have multi-select and ability to make alterations on everything in the LW UI please?
 

lardbros

Not so newbie member
...... The stupid forum broken search function is apparently never going to be fixed.

Scrub what I wrote... the search seems to work better if you click the advanced tab and search instead of using the top box!
 
Last edited:

lertola2

skeptic
Here's another thread with 'seemingly' the same issue....

Haven't tried the script though


http://forums.newtek.com/showthread...e-surfaces&highlight=rename+multiple+surfaces

No that is a Layout script renames surfaces by appending the file name to the front of the surface name. It does not combine surfaces.

What we need is a Modeler script the will search through the surface names and combine all surfaces that contain the same search string into one surface. So, for example, you have an object that has these surfaces: box_01, box_02, and sphere_01. You should be able to put in the word 'box' as the search string and then the script should find the two surfaces that contain 'box' and combine them into one surface. And the script should leave the surface named 'sphere_01' alone. Maybe to combine surfaces the script will have to select all polygons that have surfaces with the search string in them and then assign the new surfaces to them. This might be what the Change Surface script posted by Iain in the zip file above is trying to do. But it did not work for me when I tried it.

It would be nice if the surface editor itself would be re designed to allow combining of surfaces but I doubt if that will ever happen. Maybe Newtek could add the option in fbx export to save the surfaces in each object with their proper name and not append a number to it. That would be great but it would not help the case when importing fbx from other programs that have multiple names for the same surface.
 
Last edited:

lardbros

Not so newbie member
No that is a Layout script renames surfaces by appending the file name to the front of the surface name. It does not combine surfaces.

What we need is a Modeler script the will search through the surface names and combine all surfaces that contain the same search string into one surface. So, for example, you have an object that has these surfaces: box_01, box_02, and sphere_01. You should be able to put in the word 'box' as the search string and then the script should find the two surfaces that contain 'box' and combine them into one surface. And the script should leave the surface named 'sphere_01' alone. Maybe to combine surfaces the script will have to select all polygons that have surfaces with the search string in them and then assign the new surfaces to them. This might be what the Change Surface script posted by Iain in the zip file above is trying to do. But it did not work for me when I tried it.

It would be nice if the surface editor itself would be re designed to allow combining of surfaces but I doubt if that will ever happen. Maybe Newtek could add the option in fbx export to save the surfaces in each object with their proper name and not append a number to it. That would be great but it would not help the case when importing fbx from other programs that have multiple names for the same surface.

Sorry, I do know what we're after, I've been after this for a LOOOONG time!... I never looked in detail at what the thread I posted...

This is so frustrating and simply leads me to believe that there aren't many LightWave users that are delving into the FBX and importing it into LW from other packages. Shame!! :(
 

jeric_synergy

Axes grinder- Dongle #99
Well, it's a shame that I don't have any need for such activity, surely. I'd be delving like a crazed delver if I had such a gig.
 

lertola2

skeptic
Sorry, I do know what we're after, I've been after this for a LOOOONG time!... I never looked in detail at what the thread I posted...

This is so frustrating and simply leads me to believe that there aren't many LightWave users that are delving into the FBX and importing it into LW from other packages. Shame!! :(

Or they are just suffering in silence and working around the problem as best they can which is what I usually do. Someone should submit a bug report feature request so that Newtek becomes aware of the problem.

I did try Iain's lscript (which is in the code window of his first post above) and it did work although it was painfully slow on one of my files. I could not get the python scripts that are attached to that message to work. Also in this thread http://forums.newtek.com/showthread...urface-in-one-surface&highlight=changesurface which Iain gave the link for above is a link to this script: https://www.lightwave3d.com/assets/plugins/entry/cp_selectsurfnames/. This script will select polygons based on a search string. I think that is just as good as a script that combines surfaces because once it is run you can change the surface on all the polygons at once.

-Joe
 
Top Bottom