forked from LeenkxTeam/LNXSDK
Compare commits
9 Commits
99a5d7d445
...
b440539d65
| Author | SHA1 | Date | |
|---|---|---|---|
| b440539d65 | |||
| 60a9db6459 | |||
| 3b5a93c92a | |||
| 4af990796e | |||
| 9fb4916c3c | |||
| f61d5833bb | |||
| 40b52be713 | |||
| 07d8422f22 | |||
| 7179d42b27 |
@ -2,10 +2,12 @@
|
|||||||
-cp ../Kha/Backends/Krom
|
-cp ../Kha/Backends/Krom
|
||||||
-cp ../leenkx/Sources
|
-cp ../leenkx/Sources
|
||||||
-cp ../iron/Sources
|
-cp ../iron/Sources
|
||||||
|
-cp ../lib/aura/Sources
|
||||||
-cp ../lib/haxebullet/Sources
|
-cp ../lib/haxebullet/Sources
|
||||||
-cp ../lib/haxerecast/Sources
|
-cp ../lib/haxerecast/Sources
|
||||||
-cp ../lib/zui/Sources
|
-cp ../lib/zui/Sources
|
||||||
--macro include('iron', true, null, ['../iron/Sources'])
|
--macro include('iron', true, null, ['../iron/Sources'])
|
||||||
|
--macro include('aura', true, null, ['../lib/aura/Sources'])
|
||||||
--macro include('haxebullet', true, null, ['../lib/haxebullet/Sources'])
|
--macro include('haxebullet', true, null, ['../lib/haxebullet/Sources'])
|
||||||
--macro include('haxerecast', true, null, ['../lib/haxerecast/Sources'])
|
--macro include('haxerecast', true, null, ['../lib/haxerecast/Sources'])
|
||||||
--macro include('leenkx', true, ['leenkx.network'], ['../leenkx/Sources','../iron/Sources'])
|
--macro include('leenkx', true, ['leenkx.network'], ['../leenkx/Sources','../iron/Sources'])
|
||||||
|
|||||||
@ -889,6 +889,10 @@ class Scene {
|
|||||||
|
|
||||||
if (StringTools.endsWith(ptype, "Object") && pval != "") {
|
if (StringTools.endsWith(ptype, "Object") && pval != "") {
|
||||||
Reflect.setProperty(traitInst, pname, Scene.active.getChild(pval));
|
Reflect.setProperty(traitInst, pname, Scene.active.getChild(pval));
|
||||||
|
} else if (ptype == "TSceneFormat" && pval != "") {
|
||||||
|
Data.getSceneRaw(pval, function (r: TSceneFormat) {
|
||||||
|
Reflect.setProperty(traitInst, pname, r);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (ptype) {
|
switch (ptype) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class Time {
|
|||||||
return 1 / frequency;
|
return 1 / frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
static var _fixedStep: Null<Float>;
|
static var _fixedStep: Null<Float> = 1/60;
|
||||||
public static var fixedStep(get, never): Float;
|
public static var fixedStep(get, never): Float;
|
||||||
static function get_fixedStep(): Float {
|
static function get_fixedStep(): Float {
|
||||||
return _fixedStep;
|
return _fixedStep;
|
||||||
|
|||||||
@ -73,7 +73,17 @@ class PhysicsBreak extends Trait {
|
|||||||
collisionMargin: 0.04,
|
collisionMargin: 0.04,
|
||||||
linearDeactivationThreshold: 0.0,
|
linearDeactivationThreshold: 0.0,
|
||||||
angularDeactivationThrshold: 0.0,
|
angularDeactivationThrshold: 0.0,
|
||||||
deactivationTime: 0.0
|
deactivationTime: 0.0,
|
||||||
|
linearVelocityMin: 0.0,
|
||||||
|
linearVelocityMax: 0.0,
|
||||||
|
angularVelocityMin: 0.0,
|
||||||
|
angularVelocityMax: 0.0,
|
||||||
|
lockTranslationX: false,
|
||||||
|
lockTranslationY: false,
|
||||||
|
lockTranslationZ: false,
|
||||||
|
lockRotationX: false,
|
||||||
|
lockRotationY: false,
|
||||||
|
lockRotationZ: false
|
||||||
};
|
};
|
||||||
o.addTrait(new RigidBody(Shape.ConvexHull, ud.mass, ud.friction, 0, 1, params));
|
o.addTrait(new RigidBody(Shape.ConvexHull, ud.mass, ud.friction, 0, 1, params));
|
||||||
if (cast(o, MeshObject).data.geom.positions.values.length < 600) {
|
if (cast(o, MeshObject).data.geom.positions.values.length < 600) {
|
||||||
|
|||||||
@ -3057,6 +3057,8 @@ class LeenkxExporter:
|
|||||||
|
|
||||||
if trait_prop.type.endswith("Object"):
|
if trait_prop.type.endswith("Object"):
|
||||||
value = lnx.utils.asset_name(trait_prop.value_object)
|
value = lnx.utils.asset_name(trait_prop.value_object)
|
||||||
|
elif trait_prop.type == "TSceneFormat":
|
||||||
|
value = lnx.utils.asset_name(trait_prop.value_scene)
|
||||||
else:
|
else:
|
||||||
value = trait_prop.get_value()
|
value = trait_prop.get_value()
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,8 @@ PROP_TYPE_ICONS = {
|
|||||||
"CameraObject": "CAMERA_DATA",
|
"CameraObject": "CAMERA_DATA",
|
||||||
"LightObject": "LIGHT_DATA",
|
"LightObject": "LIGHT_DATA",
|
||||||
"MeshObject": "MESH_DATA",
|
"MeshObject": "MESH_DATA",
|
||||||
"SpeakerObject": "OUTLINER_DATA_SPEAKER"
|
"SpeakerObject": "OUTLINER_DATA_SPEAKER",
|
||||||
|
"TSceneFormat": "SCENE_DATA"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ class LnxTraitPropListItem(bpy.types.PropertyGroup):
|
|||||||
("CameraObject", "Camera Object", "Camera Object Type"),
|
("CameraObject", "Camera Object", "Camera Object Type"),
|
||||||
("LightObject", "Light Object", "Light Object Type"),
|
("LightObject", "Light Object", "Light Object Type"),
|
||||||
("MeshObject", "Mesh Object", "Mesh Object Type"),
|
("MeshObject", "Mesh Object", "Mesh Object Type"),
|
||||||
("SpeakerObject", "Speaker Object", "Speaker Object Type")),
|
("SpeakerObject", "Speaker Object", "Speaker Object Type"),
|
||||||
|
("TSceneFormat", "Scene", "Scene Type")),
|
||||||
name="Type",
|
name="Type",
|
||||||
description="The type of this property",
|
description="The type of this property",
|
||||||
default="String",
|
default="String",
|
||||||
@ -78,6 +80,7 @@ class LnxTraitPropListItem(bpy.types.PropertyGroup):
|
|||||||
name="Value", type=bpy.types.Object, poll=filter_objects,
|
name="Value", type=bpy.types.Object, poll=filter_objects,
|
||||||
override={"LIBRARY_OVERRIDABLE"}
|
override={"LIBRARY_OVERRIDABLE"}
|
||||||
)
|
)
|
||||||
|
value_scene: PointerProperty(name="Value", type=bpy.types.Scene, override={"LIBRARY_OVERRIDABLE"})
|
||||||
|
|
||||||
def set_value(self, val):
|
def set_value(self, val):
|
||||||
# Would require way too much effort, so it's out of scope here.
|
# Would require way too much effort, so it's out of scope here.
|
||||||
@ -126,6 +129,11 @@ class LnxTraitPropListItem(bpy.types.PropertyGroup):
|
|||||||
if self.value_object is not None:
|
if self.value_object is not None:
|
||||||
return self.value_object.name
|
return self.value_object.name
|
||||||
return ""
|
return ""
|
||||||
|
if self.type == "TSceneFormat":
|
||||||
|
if self.value_scene is not None:
|
||||||
|
return self.value_scene.name
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
return self.value_string
|
return self.value_string
|
||||||
|
|
||||||
@ -144,6 +152,8 @@ class LNX_UL_PropList(bpy.types.UIList):
|
|||||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||||
if item.type.endswith("Object"):
|
if item.type.endswith("Object"):
|
||||||
sp.prop_search(item, "value_object", context.scene, "objects", text="", icon=custom_icon)
|
sp.prop_search(item, "value_object", context.scene, "objects", text="", icon=custom_icon)
|
||||||
|
elif item.type.endswith("TSceneFormat"):
|
||||||
|
sp.prop_search(item, "value_scene", bpy.data, "scenes", text="", icon=custom_icon)
|
||||||
else:
|
else:
|
||||||
use_emboss = item.type in ("Bool", "String")
|
use_emboss = item.type in ("Bool", "String")
|
||||||
sp.prop(item, item_value_ref, text="", emboss=use_emboss)
|
sp.prop(item, item_value_ref, text="", emboss=use_emboss)
|
||||||
|
|||||||
@ -444,7 +444,7 @@ def fetch_script_props(filename: str):
|
|||||||
|
|
||||||
# Property type is annotated
|
# Property type is annotated
|
||||||
if p_type is not None:
|
if p_type is not None:
|
||||||
if p_type.startswith("iron.object."):
|
if p_type.startswith("iron.object.") or p_type == "iron.data.SceneFormat.TSceneFormat":
|
||||||
p_type = p_type[12:]
|
p_type = p_type[12:]
|
||||||
elif p_type.startswith("iron.math."):
|
elif p_type.startswith("iron.math."):
|
||||||
p_type = p_type[10:]
|
p_type = p_type[10:]
|
||||||
@ -522,7 +522,7 @@ def get_type_default_value(prop_type: str):
|
|||||||
if prop_type == "Float":
|
if prop_type == "Float":
|
||||||
return 0.0
|
return 0.0
|
||||||
if prop_type == "String" or prop_type in (
|
if prop_type == "String" or prop_type in (
|
||||||
"Object", "CameraObject", "LightObject", "MeshObject", "SpeakerObject"):
|
"Object", "CameraObject", "LightObject", "MeshObject", "SpeakerObject", "TSceneFormat"):
|
||||||
return ""
|
return ""
|
||||||
if prop_type == "Bool":
|
if prop_type == "Bool":
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user