Softimage Mod Tool not starting with user defined default project

General questions and troubleshooting SOFTIMAGE©
Post Reply
User avatar
minilogoguy18
Posts: 110
Joined: 24 Dec 2012, 19:34

Softimage Mod Tool not starting with user defined default project

Post by minilogoguy18 » 10 Dec 2018, 23:57

Tried to do a quick google search on this with no luck. Does anyone know why setting a default project doesn't seem to do anything? Every time I open the software it loads the "Modtool_Database" project rather than the one that I have set.

Is this something that is specific to this freeware version of Softimage or does it happen in the full version?

User avatar
myara
Posts: 403
Joined: 28 Sep 2011, 10:33

Re: Softimage Mod Tool not starting with user defined default project

Post by myara » 19 Dec 2018, 04:00

I haven't used Mod Tool in years so I can't tell anything about it. The full version Softimage opens the last used project and this project path is stored in a file called default.xsipref inside your Data\Preferences folder. You can open this file in a text editor and change it.
M.Yara
Character Modeler | Softimage Generalist (sort of)

User avatar
minilogoguy18
Posts: 110
Joined: 24 Dec 2012, 19:34

Re: Softimage Mod Tool not starting with user defined default project

Post by minilogoguy18 » 07 Jan 2019, 06:55

Yeah it's set in there, must be something hard coded with Mod Tool like how it automatically opens net view with the mod tool resources page.

User avatar
myara
Posts: 403
Joined: 28 Sep 2011, 10:33

Re: Softimage Mod Tool not starting with user defined default project

Post by myara » 07 Jan 2019, 08:00

If you have the last used scene inside your default.xsipref, then you could try writing a script to load the last project using the ActiveProject command.

The default.xsipref stores the last directory, not the project itself so if you have changed the structure, and you want to set your project through this file, it may not work well but it's a start.

Code: Select all

//JScript
var fso = new ActiveXObject("Scripting.FileSystemObject");
pref_File = "C:\\Users\\myara\\Autodesk\\Softimage_2013_SP1\\Data\\Preferences\\default.xsipref"
f = fso.OpenTextFile(pref_File, 1)
while (!f.AtEndOfStream) {
    var line = f.ReadLine();
    if (line.search('last_sequence_dir') != -1 ){
        // Get Scene Path
        scenesPath = line.substr(line.search("= ")+2)
        // Get Path without \Scenes
        projPath = scenesPath.substr(0, scenesPath.toLowerCase().lastIndexOf("\\scenes"))
        if (fso.FolderExists(projPath)){
            if (fso.FolderExists(projPath + "\\system")){
                LogMessage (projPath)
                ActiveProject = projPath
                break
            }
        }
    }
}
f.Close()

You would have to replace the pref_File variable with your local path.
This code opens the default.xsipref and searches for the last used scene path, strips the "Scene" part and assumes it is the last used project.
If the folder exists, just in case it will verify if the system folder exists. If it does, then it will set it as the active project.

It won't search in other directories, for that you would have to write a recursive function.
If you haven't changed the project structure, then it should work.

You could also put this in an event to load it on start.
M.Yara
Character Modeler | Softimage Generalist (sort of)

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Softimage Mod Tool not starting with user defined default project

Post by Hirazi Blue » 07 Jan 2019, 15:14

If I recall correctly (and that's a big "IF" after all these years), the Mod Tool starts by calling a script file called "ModStartup.js".
This can be modified, but I can't recall how and can't seem to find any more info on it on the internet.
Maybe you could post the content of that file, so we can figure out, what needed to be done to this file to make it work in the intended manner...
;)
Stay safe, sane & healthy!

User avatar
minilogoguy18
Posts: 110
Joined: 24 Dec 2012, 19:34

Re: Softimage Mod Tool not starting with user defined default project

Post by minilogoguy18 » 07 Jan 2019, 17:37

Code: Select all

	in_reg.Author = "Softimage";
	in_reg.Name = "ModStartup";
	in_reg.Email = "";
	in_reg.URL = "";
	in_reg.Major = 1;
	in_reg.Minor = 0;

	in_reg.RegisterEvent("ModStartupEvent",siOnStartup);
	

	return true;
}

function XSIUnloadPlugin( in_reg )
{
	// If not "Mod Tool" then Plugin was disabled.
	if ( Application.License != "Mod Tool" )
	{
		return true;
	}

	return true;
}


// Callback for the ModStartupEvent event.
function ModStartupEvent_OnEvent( in_ctxt )
{
	// check if check for update is turned off
	var oPreferences = Application.Preferences;
	//if ( oPreferences.GetPreferenceValue( "ModTool.CheckForUpdates" ) == "True")
	{
		Application.ExecuteCommand ( "SIAutoUpdate" );
	}

	//if ( oPreferences.GetPreferenceValue( "ModTool.ShowSplash" ) == "True")
	{
		var oActiveLayout = Application.Desktop.ActiveLayout;
		var oNETVIEW  = oActiveLayout.CreateView( "Netview", "ModToolNetview" );
		var pathToModToolWeb = Application.GetInstallationPath2( siInstallationPath.siAddonPath );
		pathToModToolWeb += "\\ModTool\\Data\\HTML\\modtool.html";
		oNETVIEW.SetAttributeValue( "url", pathToModToolWeb );
		oNETVIEW.SetAttributeValue( "toolbar", false );

		oNETVIEW.Resize( 826, 598 );
		var w = ModGetScreenWidth();
		var h = ModGetScreenHeight();
		var wt = (w - 826) / 2;
		var ht = (h -598) / 2;
		oNETVIEW.Move( wt, ht );
	}

	// Set the Database Path to the ModTool DB
	var pathToModToolDB = Application.GetInstallationPath2( siInstallationPath.siAddonPath );
	Application.ActiveProject2 = Application.CreateProject( pathToModToolDB + "\\ModTool_Database");

	return true;
}
Found it, managed to get it to actually load the default project now by just deleting the lines at the end. Even though I set the showsplash to "False" it still pops up the netview at start with the modtool resources. Probably just gonna have to delete that too. Thanks guys for helping someone out that's using this old software. Using it to try to avoid any legal troubles.
Last edited by minilogoguy18 on 07 Jan 2019, 17:47, edited 2 times in total.

User avatar
myara
Posts: 403
Joined: 28 Sep 2011, 10:33

Re: Softimage Mod Tool not starting with user defined default project

Post by myara » 07 Jan 2019, 17:46

Well, that’s it.
Add a // before the Application.ActiveProject2 to make it inactive (comment)
This will prevent XSI from creating and setting a Modtool database project. I’m not sure if by not doing it, it will affect some tools.
I’ve never used modtool, but my guess is it should be fine without setting that project folder every single time

If you don’t need any of that at all, you could comment the line
in_reg.RegisterEvent (with //) that will prevent from executing anything. It would be easier to just move the file but XSI may need it, I don’t know.
Last edited by myara on 07 Jan 2019, 17:50, edited 1 time in total.
M.Yara
Character Modeler | Softimage Generalist (sort of)

User avatar
minilogoguy18
Posts: 110
Joined: 24 Dec 2012, 19:34

Re: Softimage Mod Tool not starting with user defined default project

Post by minilogoguy18 » 07 Jan 2019, 17:48

Yeah it worked, got it to load like the commercial version, no netview popup, disabled checking for updates from Autodesk and the default project I set now loads.

Now if only I could find out how to disable whatever is preventing me from using EMDL (Model) export...

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests