Page 1 of 3 123 LastLast
Results 1 to 15 of 34

Thread: Can I replace all layers in a layout object with the same layers from another?

  1. #1
    May the sauce be with you starbase1's Avatar
    Join Date
    Feb 2003
    Location
    London, UK
    Posts
    5,638

    Can I replace all layers in a layout object with the same layers from another?

    Subject line pretty much says it all - I have a complex object with many layers set up in a scene, and I'd like to replace all layers from one version with all layers from a different version.

    I can do it one layer at a time, but it would be a lot less error prone and time consuming to do the whole lot in one hit. Is this possible?

    LW 11.5

    Nick
    Specialist subjects: Unflown space projects, and the space program of the Soviet Union.

    My main Web site

  2. #2
    it's a manhole cover ↓ JoePoe's Avatar
    Join Date
    Jun 2006
    Location
    LISA
    Posts
    1,969
    Can you, with layout closed, simply rename the new object with the old objects name and place it in the the right path?
    (do whatever naming backup dance you need to do first of course).

    Once that's done, with both open, save the object with the name you really want and it will update automatically. Yes?
    Last edited by JoePoe; 11-04-2013 at 08:04 AM.
    System Specs: A pile of sand, a couple of wires, a real live mouse and a beer.

  3. #3
    Stuck in a very big cube Waves of light's Avatar
    Join Date
    Aug 2007
    Location
    South Yorkshire, England
    Posts
    2,500
    You can open up the .lws file in a text editor and do a find and replace on the object ID. But be careful, backup everything first before attempting this.

    For instance, in my current scene file there is a line that I believe calls the object file and then places it in the scene:

    'LoadObjectLayer 43 10000016 Objects/_MyProjects/Arch_Viz/Football_Stadiums_Brazil2014_obj/Maracana_Stadium_v048.lwo'

    so I would just do a find and replace using:

    Football_Stadiums_Brazil2014_obj/Maracana_Stadium_v048.lwo

    to

    Football_Stadiums_Brazil2014_obj/Maracana_Stadium_v049.lwo

    Save the file and see if it opens up in layout correctly, then incrementally save your scene file, just to be on the safe side.

    I messed up one of my scene files, because I did the above routine and there were instances of a single referenced objects and it didn't seem to like that. When I re-opened the scene file, it took ages for it to load and there were no instances of the object in the scene.

    EDIT: And by instance, I mean Add | Clone | Clone Instance.

    Cheers,

    Ricky.
    Last edited by Waves of light; 11-04-2013 at 07:23 AM.


    Systen Spec: i7 4930k (OC @4.5ghz),ASUS p9x79 MB, 32GB Ballistix RAM, H60 cooling, Samsung SSD 120GB, WD 1TB

  4. #4
    May the sauce be with you starbase1's Avatar
    Join Date
    Feb 2003
    Location
    London, UK
    Posts
    5,638
    Thanks for the suggestions - I had thought of renaming away the object, but then other scenes that use it would not find it. And the manual editing of the scene file is a bit of a kludge...

    Given that there are replace with object commands, I was hoping to have missed an option with this. The way it works at the moment feels like a hangover from when object files had only one layer...
    Specialist subjects: Unflown space projects, and the space program of the Soviet Union.

    My main Web site

  5. #5
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,740
    If I understand what you're saying: YES, it does seem like a hangover.

    When one replaces a "object" which is a layer in a multi-mesh, shouldn't we get a dialog asking if all the other objects/layers from that new source file be replaced also????

    This seems like the kind of SIMPLE "feature" that could (and maybe HAS) be easily addressed with a script. "Better Object Replace.lws" would be a good name.
    Last edited by jeric_synergy; 11-04-2013 at 10:53 AM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  6. #6
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    If you replace the first layer associated with an object it will swap out all the layers associated with it.

    However, if you've imported a layer manually, that layer has no relationship with the first layer as that "load object" operation is separate from your other "load object" operation.

    I was working on a script that made doing this more intelligent. I believe Dodgy was as well. The problem is that there's no way to get the index id of a layer. Checking which layer is what is done by comparing the name of the layer so the script is dependent on someone giving all their layers unique names. If all the layers are called "unnamed" then the script will fail. I'd say submit a request to get index id via lscript/python. Then you, or we could finish our scripts.

    Doing a find/replace in a text editor on the lws file is your quickest solution right now.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  7. #7
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,740
    so there's no programmatic way to determine the source file name, and search the scene for similar?

    Is the id# you refer to on the Layout or the Modeler side?

    I'm hoping they get this facility into Python: seems like that would be a really handy bit of info to have accessible.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  8. #8
    it's a manhole cover ↓ JoePoe's Avatar
    Join Date
    Jun 2006
    Location
    LISA
    Posts
    1,969
    Quote Originally Posted by starbase1 View Post
    ....but then other scenes that use it would not find it.
    "My" methods specifically addresses this.
    Once the new file is in place and renamed give the original it's original name again. It will be where it needs to be and named correctly for everywhere else it's used.

    It sounds convoluted but it's really only four naming steps.

    It's a little like an easy setup of the classic Tower of Hanoi game.
    System Specs: A pile of sand, a couple of wires, a real live mouse and a beer.

  9. #9
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Quote Originally Posted by jeric_synergy View Post
    so there's no programmatic way to determine the source file name, and search the scene for similar?
    No, there is a way. My script works for my needs but I'm also very careful to give my layers unique names. So it works. However for me to release it as a gift to the LW Community, I'd want it to be as fool proof as possible. The current way we can determine Modeler layers is not fool proof

    Quote Originally Posted by jeric_synergy View Post
    Is the id# you refer to on the Layout or the Modeler side?
    It'd be on the model file side...so it wouldn't be specific to L or M.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  10. #10
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,740
    Nick, perhaps a helpful adjunct would be a Modeler script that at least gave simple unique names to all unnamed layers.

    SIDE NOTE: I almost always have more Hidden layers than Visible/Active -- in fact I've requested a preference switch where all Layers START as Hidden*, and are only made active by user intention-- and usually I'll add an "NV" to a Layer Name to indicate/document that I don't want to see the layer. (*This would prevent the common-for me- mistake of when I make, say, a CUTTER layer, and it gets sent to Layout when I don't want it to.)

    If I were to write the script above, I'd add a function where "Occupied but non-visible Layers" got names that started/ended in "-NV-".
    Last edited by jeric_synergy; 11-04-2013 at 12:42 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  11. #11
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Quote Originally Posted by jeric_synergy View Post
    Nick, perhaps a helpful adjunct would be a Modeler script that at least gave simple unique names to all unnamed layers.
    Define "simple".

    If the LWG can add the layer index that'd be the best solution, instead of some wonky hack workaround. Submitting a feature request would be my suggestion, instead of someone spending the time to make a lscript that has limited usefulness.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  12. #12
    Stuck in a very big cube Waves of light's Avatar
    Join Date
    Aug 2007
    Location
    South Yorkshire, England
    Posts
    2,500
    Thanks for this Nick, it'll be interesting to see what you come up with.


    Systen Spec: i7 4930k (OC @4.5ghz),ASUS p9x79 MB, 32GB Ballistix RAM, H60 cooling, Samsung SSD 120GB, WD 1TB

  13. #13
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,740

    more is MORE

    Quote Originally Posted by nickdigital View Post
    Define "simple".
    Yes. I'd probably go with"Auto-(systemclocktime)", or "NV-Auto-(systemclocktime)" in the case of a non-visible layer. Or, the Layer Number. (The latter has the advantage of brevity, and I'm still not happy how hard LW makes it to see and USE long layer names.)

    Obviously, the more parameters LWG can expose to Python and LScript (which they should probably just abandon, as Bob's time is 'WAYYYYYyyyyy better spent on Python IMO) the better. I'm not sure why we have to keep beating THAT drum. The more hooks scripters have to use, the more they can bend the software to their own uses.
    Last edited by jeric_synergy; 11-04-2013 at 12:52 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  14. #14
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Quote Originally Posted by jeric_synergy View Post
    ....

    If I were to write the script above, I'd add a function where "Occupied but non-visible Layers" got names that started/ended in "-NV-".
    I believe what you described is very do-able. Your script would iterate through all the layers, and just turn off any layer that contained the string "-NV-".
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  15. #15
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,740
    Quote Originally Posted by nickdigital View Post
    I believe what you described is very do-able. Your script would iterate through all the layers, and just turn off any layer that contained the string "-NV-".
    Well, that would be another function, part of the "assign unique names" function, really sort of the inverse. But it could be part of suite of "hidden layers" functions. Since I almost always only have one or two IMPORTANT layers, e.g. "Main" and "Eyes", turning them ON is usually trivial compared to turning OFF nineteen 'work layers'.

    I've rather garbled this up, so to recap:
    1) to use YOUR system, Nick, an "auto-namer" would be desirable to avoid the labor of naming layers when it's not all that important for documentation purposes, ie. only uniqueness matters
    2) for my workflow, adding "-NV-" to already Hidden layers would be desirable, and
    3) "Auto-hiding" layers with "-NV-" in their Layer name would also be desirable.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •