← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 701: Fixing 1.4.3 to be compatible with older version's of OSP files.

 

------------------------------------------------------------
revno: 701
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sun 2012-09-09 19:29:58 -0500
message:
  Fixing 1.4.3 to be compatible with older version's of OSP files.
modified:
  openshot/classes/clip.py
  openshot/classes/transition.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/clip.py'
--- openshot/classes/clip.py	2012-09-07 20:37:38 +0000
+++ openshot/classes/clip.py	2012-09-10 00:29:58 +0000
@@ -2311,6 +2311,8 @@
 			state['video_fade_in_amount'] = 2.0
 		if 'video_fade_out_amount' not in state:
 			state['video_fade_out_amount'] = 2.0
+		if 'stored_x' not in state:
+			state['stored_x'] = 0.0
 
 		# update the state object with new schema changes
 		self.__dict__.update(state)

=== modified file 'openshot/classes/transition.py'
--- openshot/classes/transition.py	2012-09-09 20:08:32 +0000
+++ openshot/classes/transition.py	2012-09-10 00:29:58 +0000
@@ -43,6 +43,17 @@
 		self.mask_value = mask_value	# 0.0 to 1.0
 
 
+	#----------------------------------------------------------------------
+	def __setstate__(self, state):
+		""" This method is called when an OpenShot project file is un-pickled (i.e. opened).  It can
+		    be used to update the structure of old clip classes, to make old project files compatable with
+		    newer versions of OpenShot. """
+
+		# Check for missing DEBUG attribute (which means it's an old project format)
+		if 'stored_x' not in state:
+			state['stored_x'] = 0.0
+
+
 	def Render(self, exiting_item=None, x_offset = 0):
 
 		# get a reference to the 2 main canvas objects & theme
@@ -501,12 +512,6 @@
 			# Set the new position
 			self.position_on_track = new_position_on_track
 
-			# Animate the transition to it's new position
-			#item.animate(distance_from_clip, bottom_y - item.get_bounds().y1, 1.0, 0.0, False, 200, 4, goocanvas.ANIMATE_FREEZE)
-
-			# move the clip object on the timeline to correct position (snapping to the y and x of the track)		
-			#item.translate (distance_from_clip, bottom_y - item.get_bounds().y1)
-
 			# remove old canvas item
 			parent = item.get_parent()
 			child_num = parent.find_child (item)