Auto Copy MH blender scripts possible??

This forum is aimed at user contributions, in the form of assets, side projects, code patches and similar.

Moderator: joepal

Auto Copy MH blender scripts possible??

Postby robertltux » Mon Mar 05, 2012 6:25 pm

Given that there is now a good number of scripts and folders that need to be copied to Blender (for the various Make* functions) how about this.
During startup MakeHuman can look in the Blender scripts folder for a set of "marker" files and if the date on those markers is earlier than the ones in the MakeHuman Utils folder then that script/script folder can be copied over to the addons folder.

btw can we get a list of the current set of plugins??
robertltux
 

Re: Auto Copy MH blender scripts possible??

Postby ThomasL » Tue Mar 06, 2012 10:32 am

The simplest thing is probably to write a bat file/shell script to do the copying. Most users will probably not use the Make* scripts.

The problem is to find Blender's addon folder. Many people don't install Blender, but just unzip it somewhere and no environment variables are set.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Auto Copy MH blender scripts possible??

Postby robertltux » Tue Mar 06, 2012 3:14 pm

ThomasL wrote:The simplest thing is probably to write a bat file/shell script to do the copying. Most users will probably not use the Make* scripts.

The problem is to find Blender's addon folder. Many people don't install Blender, but just unzip it somewhere and no environment variables are set.


then it becomes a bit easy to find

1 the unzipped folder has a scripts folder
2 i think that the first time Blender runs it sets up the appdata folder
robertltux
 

Re: Auto Copy MH blender scripts possible??

Postby ThomasL » Wed Mar 07, 2012 6:04 am

I added a bat file which does the copying. Type

Code: Select all
copy2blender name\of\Blender\addon\folder


at the top level. It's up to you to tell the script were Blender is located. If you are on Linux, it should be straightforward to write a shell script that does the same thing.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Auto Copy MH blender scripts possible??

Postby robertltux » Thu Mar 08, 2012 2:35 pm

ThomasL wrote:I added a bat file which does the copying. Type

Code: Select all
copy2blender name\of\Blender\addon\folder


at the top level. It's up to you to tell the script were Blender is located. If you are on Linux, it should be straightforward to write a shell script that does the same thing.

a bit of a magic trick even if you are using a Zip copy of Blender it still uses the System Folders that an installed copy would use

copy2blender "%appdata%\Blender Foundation\Blender\2.61\scripts\addons"

will put the addons where they are needed (assumes a currentish zip copy)
robertltux
 

Re: Auto Copy MH blender scripts possible??

Postby duststorm » Fri Mar 09, 2012 4:19 pm

When no parameters are given the script could automatically search for a few default blender locations. On linux this could be:
/usr/share/blender
/usr/local/share/blender
/opt/blender*/
/opt/Blender*/
...

On windows something like
C:\blender*
C:\Program Files\blender*

You could make it even smarter by trying to let it use environment variables like programs_dir etc.
Additionally, if blender 2.4 is still supported at least, you can make the script guess the version of blender and install the appropriate scripts.
But anyway, users will still have to enable the addons in blender themselves using user preferences.


On the other hand.. One might also wonder whether you really want such *magic* automatic installation.
And will you install to multiple blender installations if you find more than one?
Another option might be to present the user with the found locations, and let him choose those where he wants to install the scripts.

Me, personally, I still like to do it manually myself by just creating symlinks in the version of blender I choose. But it might help a lot of users.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Auto Copy MH blender scripts possible??

Postby robertltux » Fri Mar 09, 2012 4:28 pm

duststorm wrote:When no parameters are given the script could automatically search for a few default blender locations. On linux this could be:
/usr/share/blender
/usr/local/share/blender
/opt/blender*/
/opt/Blender*/
...

On windows something like
C:\blender*
C:\Program Files\blender*
.


on windows %appdata% is the best place to stick addons the path i gave should work on i think both Vista and Win7 with any recent version of Blender.
robertltux
 


Return to User contributions

Who is online

Users browsing this forum: No registered users and 1 guest