Index: model/modelanim.h
===================================================================
--- model/modelanim.h	(revision 6969)
+++ model/modelanim.h	(working copy)
@@ -66,6 +66,8 @@
 	int loop_sound;
 	int end_sound;
 	float snd_rad;
+
+	char sub_name[NAME_LENGTH];
 };
 
 /*
Index: ship/ship.cpp
===================================================================
--- ship/ship.cpp	(revision 6969)
+++ ship/ship.cpp	(working copy)
@@ -375,6 +375,8 @@
 
 bool warning_too_many_ship_classes = false;
 
+int ship_get_subobj_model_num(ship_info* sip, char* subobj_name);
+
 // set the ship_obj struct fields to default values
 void ship_obj_list_reset_slot(int index)
 {
@@ -3177,7 +3179,13 @@
 						current_trigger->subtype = ANIMATION_SUBTYPE_ALL;
 					}
 
+					if(optional_string("+sub_name:")) {
+						stuff_string(current_trigger->sub_name, F_NAME, NAME_LENGTH);
+					} else {
+						strcpy_s(current_trigger->sub_name, "<none>");
+					}
 
+
 					if(current_trigger->type == TRIGGER_TYPE_INITIAL){
 						//the only thing initial animation type needs is the angle, 
 						//so to save space lets just make everything optional in this case
@@ -3340,7 +3348,21 @@
 
 	strcpy_s(parse_error_text, "");
 
+	// Fix up animation code references
+	for (int i = 0; i < sip->n_subsystems; i++) {
+		for (int j = 0; j < sip->subsystems[i].n_triggers; j++) {
+			if (stricmp(sip->subsystems[i].triggers[j].sub_name, "<none>")) {
+				int idx = ship_get_subobj_model_num(sip, sip->subsystems[i].triggers[j].sub_name);
+				if (idx != -1) {
+					sip->subsystems[i].triggers[j].subtype = idx;
+				} else {
+					WarningEx(LOCATION, "Could not find subobject %s in ship class %s. Animation triggers will not work correctly.\n", sip->subsystems[i].triggers[j].sub_name, sip->name);
+				}
+			}
+		}
+	}
 
+
 	return rtn;	//0 for success
 }
 
@@ -16922,3 +16944,13 @@
 			Warning(LOCATION, "Unrecognized weapon '%s' found when setting weapon targeting priorities.\n", tempname);
 	}
 }
+
+int ship_get_subobj_model_num(ship_info* sip, char* subobj_name) 
+{
+	for (int i = 0; i < sip->n_subsystems; i++) {
+		if (!stricmp(sip->subsystems[i].name, subobj_name))
+			return sip->subsystems[i].subobj_num;
+	}
+
+	return -1;
+}
\ No newline at end of file
