Request: Don't over-write EXT folder in environment.bat/sh

StephenTStephenT Fabric for MotionBuilder Posts: 77

Small request - could the environment scripts be modified to prepend to variables rather than replace them?

Makes it a bit easier (and in Max's case, possible) to setup the environment pre-launch.


And for DFG path too :)


  • borjaborja Administrator, Fabric Employee Posts: 480 admin

    Hi @StephenT

    We designed the launch scripts on purpose so they clean out all the Fabric-related environment variables and ensure starting with a clean environment. We thought that users advanced enough could easily create their own environment.bat or append yours after calling environment.bat

    Borja Morales
    Technical Product Manager
    Fabric Software Inc.

  • StephenTStephenT Fabric for MotionBuilder Posts: 77

    Yeah, we can, but I don't want to create a new env.bat for every download of FE (I go through a lot of them). I'm lazy like that :)

    In some circumstances (ie - when launching FabricMax) there is no opportunity to modify this path. We launch max via the batch DCCIntergrations/Max/launch.bat script, which calls environment.bat then runs max. The same is true of launching canvas (although thats a tiny file, so duplicating it in my own launch scripts is no biggy).

    Note that this problem would also exist for XSi, except it seems that XSi doesn't overwrite existing EXT paths.
    I haven't tested with Maya.

    I understand the desire for a clean setup, but a variable will only ever exist if I explicitly set it. The env file system works great for ensuring that variables aren't set permanently and pollute the system, so left-over defines aren't much of a concern.

  • Daniele NieroDaniele Niero Posts: 233 ✭✭

    I agree with Borja here.

    Writing a .bat or .sh file that sets a dynamic environment that is tailored to your needs, isn't particularly difficult and you can do it in so many ways...

    The ones provided with Fabric I always considered more an example than of a must-be-used thing.
    After all everybody has or should have, their own launching tools/policies and compared to other software, Fabric requires only few mandatory environment variables to run. The rest is up to us and the other tools with want to use in our daily work.

  • StephenTStephenT Fabric for MotionBuilder Posts: 77

    Yes, but switching the order would change nothing about the current workflow, and make this one other (admittedly limited) workflow.

    It may not make much difference to the standard user, but wait until you have multiple OS's, multiple machines, and are testing vs a new release of Fabric every few days. It costs a certain amount of time to update all those batch files, and then a larger amount of time is wasted when you realize you forgot one time.

    And - in terms of pedantic cleanliness - I like have Fabric bat as the last thing I call. If anything changes in the Fabric bat file, I get it automatically. If I copied out the file, I would risk missing changes. Code duplication is one of the 1000000 deadly sins in software dev :)

  • Daniele NieroDaniele Niero Posts: 233 ✭✭
    edited March 3

    @StephenT said:
    wait until you have multiple OS's, multiple machines, and are testing vs a new release of Fabric every few days. It costs a certain amount of time to update all those batch files

    I do.
    I don't mean to criticise, but maybe you are not using the right strategy to organise your launcher(s).
    For example I don't call Fabric's batch files at all, the variables to set are so few that I can do it myself in any way I want. I have my own scripts that set up my environments as I need.

    new release of Fabric every few days

    About this in particular, if I may suggest a couple of possible solutions, you could copy always your daily fabric in a specific folder, something like "FabricEngine_daily", instead of leave the name you get when you unzip the Fabric downloaded. Or you could use a symbolic link (now available also in windows), make your variable pointing to that and have to update only the link when you want to change Fabric Version.
    I use the first solution myself, but there are virtually infinite solutions. You are not forced to use what they provide as example and actually I wouldn't suggest it.

    Anyway, if you really want to still using their batch file to set the environment...

    I like have Fabric bat as the last thing I call.

    You might like it, but it's at the origin of all your problems. What is the specific reason for call it at the end, why don't you call it first and then append what you need?
    I think it's because you use just the bat file provided to call Max. But why you don't grab it and modify it so to meet your requirements?

    I hope I didn't offend you, I'm just trying to help.

  • StephenTStephenT Fabric for MotionBuilder Posts: 77

    Well, I'm a bit embarressed now, because I didn't mean to make a big deal of it (honestly, yes, I could do as you suggest, but.... eeerrrrhhhh - it's just better that way!!)

    Also, I got a bit confused on the previous post, by trying to make my situation sound more complicated than it is.

    Yeah - its basically only for running max. For anything else, the environment.bat goes first, then I setup my project paths.

    For max though I can't do that: because the bat file actually triggers the load of the application. And it calls evironment.bat right before, which nixes my paths.

    So yeah, I could make a duplicate of the Max bat file - and thats what I'm actually doing now. I have one central BAT file sets up all the paths for my different build environments and dependent libraries, then triggers the appropriate application based on an argument.

    With this setup, I can launch any of the half-dozen applications, over any of about 6 versions of fabric. And each new version I download and use only requires editing one line, and I have launchers for all applications for the new version (thanks for the suggestion of a symbolic link, but I'm working with multiple versions of Fabric simultaneously - so a single link doesn't work for me)

    Now the only actual, practical reason for my request is that if Max's bat file changes suddenly, then my duplicated copy could, potentially, be out of date.

    This is extremely unlikely, as I am the developer of FabricMax, so I'd be a pretty poor dev to not notice the change :).

    So the real reason is just that I don't like having duplicated the max bat file (which is actually kinda not-simple) into another external bat file, and it has happened to me a few times that I lose time loading an application when my set paths have been overwritten.

    And the admittedly extremely subjective opinion that code should never override the will of the developer. I set that variable dammit! Don't you be ignoring me!!

    Maybe I've just taken this all a little bit too far though :)

Sign In or Register to comment.