|
@@ -81,6 +81,11 @@ class Object implements h3d.impl.Serializable {
|
|
|
**/
|
|
|
public var ignoreCollide(get, set) : Bool;
|
|
|
|
|
|
+ /**
|
|
|
+ When enable, the object can be serialized (default : true)
|
|
|
+ **/
|
|
|
+ public var allowSerialize(get, set) : Bool;
|
|
|
+
|
|
|
var absPos : h3d.Matrix;
|
|
|
var invPos : h3d.Matrix;
|
|
|
var qRot : h3d.Quat;
|
|
@@ -109,6 +114,7 @@ class Object implements h3d.impl.Serializable {
|
|
|
inline function get_alwaysSync() return flags.has(FAlwaysSync);
|
|
|
inline function get_inheritCulled() return flags.has(FInheritCulled);
|
|
|
inline function get_ignoreCollide() return flags.has(FIgnoreCollide);
|
|
|
+ inline function get_allowSerialize() return !flags.has(FNoSerialize);
|
|
|
inline function set_posChanged(b) return flags.set(FPosChanged, b || follow != null);
|
|
|
inline function set_culled(b) return flags.set(FCulled, b);
|
|
|
inline function set_visible(b) return flags.set(FVisible,b);
|
|
@@ -118,6 +124,7 @@ class Object implements h3d.impl.Serializable {
|
|
|
inline function set_alwaysSync(b) return flags.set(FAlwaysSync, b);
|
|
|
inline function set_inheritCulled(b) return flags.set(FInheritCulled, b);
|
|
|
inline function set_ignoreCollide(b) return flags.set(FIgnoreCollide, b);
|
|
|
+ inline function set_allowSerialize(b) return !flags.set(FNoSerialize, !b);
|
|
|
|
|
|
public function playAnimation( a : h3d.anim.Animation ) {
|
|
|
return currentAnimation = a.createInstance(this);
|
|
@@ -658,7 +665,7 @@ class Object implements h3d.impl.Serializable {
|
|
|
#if hxbit
|
|
|
function customSerialize( ctx : hxbit.Serializer ) {
|
|
|
|
|
|
- var children = [for( o in children ) if( !o.flags.has(FNoSerialize) ) o];
|
|
|
+ var children = [for( o in children ) if( o.allowSerialize ) o];
|
|
|
ctx.addInt(children.length);
|
|
|
for( o in children )
|
|
|
ctx.addKnownRef(o);
|