From 2c42cfa1258ee3d76532ffc614023e0ea977575c Mon Sep 17 00:00:00 2001 From: Yosuke Matsusaka Date: Fri, 28 Aug 2015 10:50:21 +0900 Subject: [PATCH] improve presiceness of use joints and disable use segments seems not required --- simtrans/template/vrml.wrl | 2 ++ simtrans/vrml.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/simtrans/template/vrml.wrl b/simtrans/template/vrml.wrl index 38ae246..781d316 100644 --- a/simtrans/template/vrml.wrl +++ b/simtrans/template/vrml.wrl @@ -234,11 +234,13 @@ DEF {{model.name}} Humanoid { USE {{j}}{%- if loop.last == False %},{%- endif %} {%- endfor %} ] + {# segments [ {%- for l in links %} USE {{l}}{%- if loop.last == False %},{%- endif %} {%- endfor %} ] + #} name "{{model.name}}" version "1.0" } diff --git a/simtrans/vrml.py b/simtrans/vrml.py index cfdf7e8..23ad5c5 100644 --- a/simtrans/vrml.py +++ b/simtrans/vrml.py @@ -463,7 +463,8 @@ def convertchildren(self, mdata, pjoint, joints, links): nmodel['link'] = clink2 nmodel['children'] = cchildren children.append(nmodel) - joints.append(cjoint.name) + if clink and (clink.visuals or clink.collisions or len(cchildren) > 0): + joints.append(cjoint.name) links.append(cjoint.child) return (children, joints, links)