Skip to content

Commit

Permalink
feat(i3d-properties): Add property for occluder and lodDistance
Browse files Browse the repository at this point in the history
Add i3d-properties for occluder and lodDistance to support FS22 models
  • Loading branch information
ssnd292 authored Mar 23, 2022
1 parent 42d8a80 commit 7f950a7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
10 changes: 9 additions & 1 deletion addon/i3dio/ui/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class I3DNodeShapeAttributes(bpy.types.PropertyGroup):
i3d_map = {
'casts_shadows': {'name': 'castsShadows', 'default': False},
'receive_shadows': {'name': 'receiveShadows', 'default': False},
'non_renderable': {'name': 'nonRenderable', 'default': False},
'non_renderable': {'name': 'nonRenderable', 'default': False},
'is_occluder': {'name': 'occluder', 'default': False},
'distance_blending': {'name': 'distanceBlending', 'default': True},
'cpu_mesh': {'name': 'meshUsage', 'default': '0', 'placement': 'IndexedTriangleSet'},
'decal_layer': {'name': 'decalLayer', 'default': 0},
Expand All @@ -52,6 +53,12 @@ class I3DNodeShapeAttributes(bpy.types.PropertyGroup):
default=i3d_map['non_renderable']['default']
)

is_occluder: BoolProperty(
name="Occluder",
description="Is Occluder?",
default=i3d_map['is_occluder']['default']
)

distance_blending: BoolProperty(
name="Distance Blending",
description="Distance Blending",
Expand Down Expand Up @@ -106,6 +113,7 @@ def draw(self, context):
layout.prop(obj.i3d_attributes, "receive_shadows")
layout.prop(obj.i3d_attributes, "non_renderable")
layout.prop(obj.i3d_attributes, "distance_blending")
layout.prop(obj.i3d_attributes, "is_occluder")
layout.prop(obj.i3d_attributes, "cpu_mesh")
layout.prop(obj.i3d_attributes, "decal_layer")
layout.prop(obj.i3d_attributes, 'fill_volume')
Expand Down
14 changes: 12 additions & 2 deletions addon/i3dio/ui/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class I3DNodeObjectAttributes(bpy.types.PropertyGroup):
'min_clip_distance': {'name': 'minClipDistance', 'default': 0.0},
'object_mask': {'name': 'objectMask', 'default': '0', 'type': 'HEX'},
'rigid_body_type': {'default': 'none'},
'lod_distance': {'name': 'lodDistance', 'default': "Enter your LOD Distances if needed."},
'collision': {'name': 'collision', 'default': True},
'collision_mask': {'name': 'collisionMask', 'default': 'ff', 'type': 'HEX'},
'compound': {'name': 'compound', 'default': False},
Expand All @@ -53,6 +54,13 @@ class I3DNodeObjectAttributes(bpy.types.PropertyGroup):
default=True
)

lod_distance: StringProperty(
name="LOD Distance",
description="For example:0 100",
default=i3d_map['lod_distance']['default'],
maxlen=1024
)

clip_distance: FloatProperty(
name="Clip Distance",
description="Anything above this distance to the camera, wont be rendered",
Expand Down Expand Up @@ -117,6 +125,8 @@ class I3DNodeObjectAttributes(bpy.types.PropertyGroup):
)




@register
class I3D_IO_PT_object_attributes(Panel):
bl_space_type = 'PROPERTIES'
Expand All @@ -133,11 +143,11 @@ def draw(self, context):
layout.use_property_split = True
layout.use_property_decorate = False
obj = bpy.context.active_object

i3d_property(layout, obj.i3d_attributes, 'visibility', obj)
i3d_property(layout, obj.i3d_attributes, 'clip_distance', obj)
i3d_property(layout, obj.i3d_attributes, 'min_clip_distance', obj)

i3d_property(layout, obj.i3d_attributes, 'lod_distance', obj)

@register
class I3D_IO_PT_rigid_body_attributes(Panel):
Expand Down

0 comments on commit 7f950a7

Please sign in to comment.