@@ -67,6 +67,7 @@ def __init__(self, parent: Any = None) -> None:
6767 self .isGroup = None
6868 self .groupItemFlags : int = 0
6969 self .positionLocked : bool = False
70+ self .visibilityLocked : bool = False
7071 self .opacity : float = 1.0
7172 self .colorTag : TagColor = TagColor .Blue
7273 self .compositeMode : CompositeMode = CompositeMode .Union
@@ -320,14 +321,16 @@ def _propertyDecode(self, prop: int, data: bytearray) -> int:
320321 self .groupItemFlags = ioBuf .u32
321322 elif _prop_cmp (prop , AllProps .PROP_LOCK_POSITION ):
322323 self .positionLocked = ioBuf .boolean
324+ elif _prop_cmp (prop , AllProps .PROP_LOCK_VISIBILITY ):
325+ self .visibilityLocked = ioBuf .boolean
323326 elif _prop_cmp (prop , AllProps .PROP_FLOAT_OPACITY ):
324327 self .opacity = ioBuf .float32
325328 elif _prop_cmp (prop , AllProps .PROP_COLOR_TAG ):
326329 self .colorTag = list (TagColor )[ioBuf .u32 ]
327330 elif _prop_cmp (prop , AllProps .PROP_COMPOSITE_MODE ):
328- self .compositeMode = list (CompositeMode )[ioBuf .i32 ]
331+ self .compositeMode = list (CompositeMode )[abs ( ioBuf .i32 ) - 1 ]
329332 elif _prop_cmp (prop , AllProps .PROP_COMPOSITE_SPACE ):
330- self .compositeSpace = list (CompositeSpace )[ioBuf .i32 ]
333+ self .compositeSpace = list (CompositeSpace )[abs ( ioBuf .i32 ) - 1 ]
331334 elif _prop_cmp (prop , AllProps .PROP_BLEND_SPACE ):
332335 self .blendSpace = ioBuf .u32
333336 elif _prop_cmp (prop , AllProps .PROP_FLOAT_COLOR ):
@@ -479,6 +482,9 @@ def _propertyEncode(self, prop: int) -> bytearray:
479482 elif _prop_cmp (prop , AllProps .PROP_LOCK_POSITION ):
480483 if self .positionLocked is not None and self .positionLocked :
481484 ioBuf .boolean = self .positionLocked
485+ elif _prop_cmp (prop , AllProps .PROP_LOCK_VISIBILITY ):
486+ if self .visibilityLocked is not None and self .visibilityLocked :
487+ ioBuf .boolean = self .visibilityLocked
482488 elif _prop_cmp (prop , AllProps .PROP_FLOAT_OPACITY ):
483489 if self .opacity is not None and isinstance (self .opacity , float ):
484490 ioBuf .float32 = self .opacity
@@ -487,10 +493,10 @@ def _propertyEncode(self, prop: int) -> bytearray:
487493 ioBuf .u32 = list (TagColor ).index (self .colorTag )
488494 elif _prop_cmp (prop , AllProps .PROP_COMPOSITE_MODE ):
489495 if self .compositeMode is not None :
490- ioBuf .i32 = list (CompositeMode ).index (self .compositeMode )
496+ ioBuf .i32 = list (CompositeMode ).index (self .compositeMode ) + 1
491497 elif _prop_cmp (prop , AllProps .PROP_COMPOSITE_SPACE ):
492498 if self .compositeSpace is not None :
493- ioBuf .i32 = list (CompositeSpace ).index (self .compositeSpace )
499+ ioBuf .i32 = list (CompositeSpace ).index (self .compositeSpace ) + 1
494500 elif _prop_cmp (prop , AllProps .PROP_BLEND_SPACE ):
495501 if self .blendSpace is not None :
496502 ioBuf .u32 = self .blendSpace
0 commit comments