[x3d-public] X3dToPython.xslt This appears to be a common problem: handling MFNode fields
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Sat Jul 2 19:45:38 PDT 2022
John: inspecting your helpful fragments, it looks like
* Error is thrown on second WindPhysicsModel in array
* The parent node ParticleSystem contains it in a field called physics
* The physics field does not have enclosing square brackets and so is not
treated as an MFNode array
Looking at specification (and checking tooltips) confirms that the physics
field is an MFNode array:
* X3D4 Architecture, Annex 40 Particle Systems, 40.4.5 ParticleSystem
*
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-DIS/Part01/components/particleSystems.html#ParticleSystem
* X3D Tooltips, ParticleSystem node, physics field
* https://www.web3d.org/x3d/content/X3dTooltips.html#ParticleSystem.physics
I scanned through X3DUOM (which lists 175 MFNode fields) and found a number
other missing MFNode fields as well:
* attrib, pickTarget, shaders, parts, programs, outputs, rootNode, data,
layers
* ComposedTexture3D field texture (MultiTexture texture also MFNode, others
SFNode)
* ParticleSystem field color, colorRamp
* RigidBody field geometry
Changes all applied in X3dToPython.xslt as part of variable isInMFNodeList,
now checked in.
Hopefully that clears several of your tests. Thanks for this report.
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, Navy robotics https:// faculty.nps.edu/brutzman
From: John Carlson <yottzumm at gmail.com>
Sent: Friday, June 24, 2022 1:06 PM
To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics public
mailing list <x3d-public at web3d.org>; holger.seelig at gmail.com
Subject: X3dToPython.xslt This appears to be a common problem. Attaching
source and generated python zip
Fire.py
File
"C:\Users\john\X3DJSONLD\src\main\python\net\x3djsonld\Library\Tests\Components\ParticleSystems\Fire.py",
line 82
WindPhysicsModel(direction=(1,-1,0),speed=0.15,gustiness=7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
Here's a piece of the source code that appears in Fire.py:
ParticleSystem(DEF='Fire2',geometryType='SPRITE',particleLifetime=2,lifetimeVariation=0.5,particleSize=(1,1),colorKey=[0],texCoordKey=[0,0.015625,0.03125,0.046875,0.0625,0.078125,0.09375,0.109375,0.125,0.140625,0.15625,0.171875,0.1875,0.203125,0.21875,0.234375,0.25,0.265625,0.28125,0.296875,0.3125,0.328125,0.34375,0.359375,0.375,0.390625,0.40625,0.421875,0.4375,0.453125,0.46875,0.484375,0.5,0.515625,0.53125,0.546875,0.5625,0.578125,0.59375,0.609375,0.625,0.640625,0.65625,0.671875,0.6875,0.703125,0.71875,0.734375,0.75,0.765625,0.78125,0.796875,0.8125,0.828125,0.84375,0.859375,0.875,0.890625,0.90625,0.921875,0.9375,0.953125,0.96875,0.984375,1],
emitter=PointEmitter(direction=(0,0,0),speed=0.2,variation=0,mass=0.1,surfaceArea=0.1),
physics=WindPhysicsModel(direction=(0,1,0),speed=0.5,gustiness=1.9),
WindPhysicsModel(direction=(1,-1,0),speed=0.15,gustiness=7)
color=ColorRGBA(color=[(1,1,1,0.1)]),
Here's the XML:
<ParticleSystem DEF='Fire2'
geometryType='SPRITE'
particleLifetime='2'
lifetimeVariation='0.5'
particleSize='1 1'
colorKey='0'
texCoordKey='0, 0.015625, 0.03125, 0.046875, 0.0625, 0.078125,
0.09375, 0.109375, 0.125, 0.140625, 0.15625, 0.171875, 0.1875, 0.203125,
0.21875, 0.234375, 0.25, 0.265625, 0.28125, 0.296875, 0.3125, 0.328125,
0.34375, 0.359375, 0.375, 0.390625, 0.40625, 0.421875, 0.4375, 0.453125,
0.46875, 0.484375, 0.5, 0.515625, 0.53125, 0.546875, 0.5625, 0.578125,
0.59375, 0.609375, 0.625, 0.640625, 0.65625, 0.671875, 0.6875, 0.703125,
0.71875, 0.734375, 0.75, 0.765625, 0.78125, 0.796875, 0.8125, 0.828125,
0.84375, 0.859375, 0.875, 0.890625, 0.90625, 0.921875, 0.9375, 0.953125,
0.96875, 0.984375, 1'>
<PointEmitter
direction='0 0 0'
speed='0.2'
variation='0'
mass='0.1'
surfaceArea='0.1'/>
<WindPhysicsModel
direction='0 1 0'
speed='0.5'
gustiness='1.9'/>
<WindPhysicsModel
direction='1 -1 0'
speed='0.15'
gustiness='7'/>
<ColorRGBA containerField='colorRamp'
color='1 1 1 0.1'/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220703/bffef5e0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5353 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220703/bffef5e0/attachment-0001.p7s>
More information about the x3d-public
mailing list