x


Run Script on Asset Server Commit/Update

I need to run a script (similar to PostProcessBuildPlayer) when a developer updates or commits to the asset server. I found the AssetPostprocessor, but it doesn't handle the asset server events directly... any thoughts?

more ▼

asked Jan 11 '10 at 05:19 PM

azupko gravatar image

azupko
19 3 3 4

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You could do this with some duct tape like solution. The flashbang guys have had a fair amount of success of making a web based viewer of Asset Server activity. Basically you'll need to periodically peek in the postgresql database, and if you see something new, run your script.

Not really elegant, but I figured I'd add a workaround in case you need it badly.

more ▼

answered Jan 14 '10 at 02:10 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8k 19 43 85

(comments are locked)
10|3000 characters needed characters left

I don't think it's possible. You can however run a script after import, which is always triggered when after updating from the asset server.

more ▼

answered Jan 14 '10 at 01:44 PM

Joe Robins gravatar image

Joe Robins ♦♦
182 4 7 11

I'm looking for exactly this functionality (pulling code from shared SVN project automatically when an Asset Server project is updated within the Editor), how is it done? I don't see any scripting options on the Asset Server panels.

Feb 14 '11 at 09:38 AM Matt 16
(comments are locked)
10|3000 characters needed characters left

Building on Lucas's answer, if you didn't want to continuously poll Postgres you could perhaps write a trigger in C and use Postgres's trigger capability on insertion. But if you want a quick solution its probably better to poll the database. You could do that very simply with a script. For example, under OS X you can run:

psql -h http://server.hostname.com -p myPort -U myUsername -d myDatabase -c "select 'revision',max(serial) as serial from changeset;" | grep revision | cut -c15-

to get the latest revision number from the asset server. If you store this value you can compare the current asset server reversion against the previous one and take action. Otherwise your script can just exit until the next time you poll the database.

more ▼

answered May 11 '10 at 01:40 PM

Ben 2 gravatar image

Ben 2
473 20 24 41

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x351

asked: Jan 11 '10 at 05:19 PM

Seen: 988 times

Last Updated: Jan 11 '10 at 05:19 PM