Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry Tool does not generate events #150

Open
andreasplesch opened this issue Mar 6, 2022 · 1 comment
Open

Geometry Tool does not generate events #150

andreasplesch opened this issue Mar 6, 2022 · 1 comment
Labels

Comments

@andreasplesch
Copy link

Describe the bug
Modifying the geometry of an IndexedFaceSet with the Geometry Tool does not seem to generate events such as point_changed

To Reproduce
Steps to reproduce the behavior:

  1. Load scene below
  2. Edit the IndexedFaceSet with the Geometry Tool (dragging faces seems to work better than dragging points)
  3. Finish up by exiting edit mode
  4. The ROUTE to the script does not seem to work

Expected behavior
Events should be generated.

Desktop (please complete the following information):

  • OS: Debian Buster
  • Version 4.6.9
  • Nvidia

Additional context

In contrast, editing the point field numerically in the scene tree does generate events.

Here is the simple scene (The metadata redirection is from Titania)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
  <head>
    <meta name='comment' content='World of Titania'/>
    <meta name='created' content='Fri, 04 Mar 2022 18:01:17 GMT'/>
    <meta name='creator' content='Andreas Plesch'/>
    <meta name='generator' content='Titania V4.6.9, http://titania.create3000.de'/>
    <meta name='identifier' content='file:///home/andreas/Downloads/IFS2Grid.x3d'/>
    <meta name='modified' content='Sun, 06 Mar 2022 22:01:50 GMT'/>
  </head>
  <Scene>
    <WorldInfo>
      <MetadataSet DEF='Titania'
          name='Titania'
          reference='http://titania.create3000.de'>
        <MetadataSet DEF='AngleGrid' containerField='value'
            name='AngleGrid'
            reference='http://titania.create3000.de'>
          <MetadataBoolean DEF='enabled' containerField='value'
              name='enabled'
              reference='http://titania.create3000.de'
              value='false'/>
        </MetadataSet>
        <MetadataSet DEF='Grid' containerField='value'
            name='Grid'
            reference='http://titania.create3000.de'>
          <MetadataBoolean DEF='enabled_1' containerField='value'
              name='enabled'
              reference='http://titania.create3000.de'
              value='true'/>
          <MetadataInteger DEF='dimension' containerField='value'
              name='dimension'
              reference='http://titania.create3000.de'
              value='10, 10, 10'/>
          <MetadataFloat DEF='scale' containerField='value'
              name='scale'
              reference='http://titania.create3000.de'
              value='0.998064, 0.998064, 0.998064'/>
        </MetadataSet>
        <MetadataSet DEF='Selection' containerField='value'
            name='Selection'
            reference='http://titania.create3000.de'>
          <MetadataBoolean DEF='selectGeometry' containerField='value'
              name='selectGeometry'
              reference='http://titania.create3000.de'
              value='true'/>
          <MetadataSet DEF='nodes' containerField='value'
              name='nodes'
              reference='http://titania.create3000.de'>
            <IndexedFaceSet DEF='_2' containerField='value'
                coordIndex='0, 3, 4, -1, 0, 4, 1, -1, 1, 4, 5, -1, 1, 5, 2, -1, 3, 6, 7, -1, 3, 7, 4, -1, 4, 7, 8, -1, 4, 8, 5, -1'>
              <TextureCoordinate
                  point='0 0, 0.5 0, 1 0, 0 0.5, 0.5 0.5, 1 0.5, 0 1, 0.5 1, 1 1'/>
              <Coordinate DEF='_3'
                  point='0 0 0, 1.01429 0 0, 2.02858 0 0, 0.0821581 0.0837725 1, 1.08216 0.256958 1, 2.02858 0 1, 0 0 2, 1.09645 0.0837725 1.6041, 2.02858 2 2'/>
            </IndexedFaceSet>
          </MetadataSet>
        </MetadataSet>
        <MetadataSet DEF='BrowserPanel' containerField='value'
            name='BrowserPanel'
            reference='http://titania.create3000.de'>
          <MetadataString DEF='type_4' containerField='value'
              name='type'
              reference='http://titania.create3000.de'
              value='"TOP_VIEW", "MAIN_VIEW", "PERSPECTIVE_VIEW", "FRONT_VIEW"'/>
          <MetadataSet DEF='viewpoints' containerField='value'
              name='viewpoints'
              reference='http://titania.create3000.de'>
            <MetadataSet DEF='PerspectiveViewpoint' containerField='value'
                name='PerspectiveViewpoint'
                reference='http://titania.create3000.de'>
              <MetadataDouble DEF='position_5' containerField='value'
                  name='position'
                  reference='http://titania.create3000.de'
                  value='-0.192591390729083, 8.16972352953314, 1.7350380219265'/>
              <MetadataDouble DEF='orientation_6' containerField='value'
                  name='orientation'
                  reference='http://titania.create3000.de'
                  value='0.937543780921752, 0.232063797536717, 0.259148707748629, 4.86360940325994'/>
              <MetadataDouble DEF='centerOfRotation_7' containerField='value'
                  name='centerOfRotation'
                  reference='http://titania.create3000.de'
                  value='0, 0, 0'/>
              <MetadataDouble DEF='fieldOfViewScale' containerField='value'
                  name='fieldOfViewScale'
                  reference='http://titania.create3000.de'
                  value='1'/>
            </MetadataSet>
            <MetadataSet DEF='TopViewpoint' containerField='value'
                name='TopViewpoint'
                reference='http://titania.create3000.de'>
              <MetadataDouble DEF='position_8' containerField='value'
                  name='position'
                  reference='http://titania.create3000.de'
                  value='-1.09760937230661, 10000, -0.263159422432941'/>
              <MetadataDouble DEF='orientation_9' containerField='value'
                  name='orientation'
                  reference='http://titania.create3000.de'
                  value='1, 0, 0, 4.71238898038469'/>
              <MetadataDouble DEF='centerOfRotation_10' containerField='value'
                  name='centerOfRotation'
                  reference='http://titania.create3000.de'
                  value='-1.12967062492115, 0, -0.169427407436293'/>
              <MetadataDouble DEF='fieldOfViewScale_11' containerField='value'
                  name='fieldOfViewScale'
                  reference='http://titania.create3000.de'
                  value='0.818096050890156'/>
            </MetadataSet>
            <MetadataSet DEF='FrontViewpoint' containerField='value'
                name='FrontViewpoint'
                reference='http://titania.create3000.de'>
              <MetadataDouble DEF='position_12' containerField='value'
                  name='position'
                  reference='http://titania.create3000.de'
                  value='-0.105339824762578, 0.357109711791097, 10000'/>
              <MetadataDouble DEF='orientation_13' containerField='value'
                  name='orientation'
                  reference='http://titania.create3000.de'
                  value='0, 0, 1, 0'/>
              <MetadataDouble DEF='centerOfRotation_14' containerField='value'
                  name='centerOfRotation'
                  reference='http://titania.create3000.de'
                  value='-0.11418741679323, 0.374883193127007, 0'/>
              <MetadataDouble DEF='fieldOfViewScale_15' containerField='value'
                  name='fieldOfViewScale'
                  reference='http://titania.create3000.de'
                  value='0.493188951044997'/>
            </MetadataSet>
          </MetadataSet>
        </MetadataSet>
        <MetadataSet DEF='Page' containerField='value'
            name='Page'
            reference='http://titania.create3000.de'>
          <MetadataInteger DEF='activeView' containerField='value'
              name='activeView'
              reference='http://titania.create3000.de'
              value='2'/>
          <MetadataInteger DEF='multiView' containerField='value'
              name='multiView'
              reference='http://titania.create3000.de'
              value='1'/>
        </MetadataSet>
      </MetadataSet>
    </WorldInfo>
    <Transform DEF='ElevationGrid'
        translation='10 0 0'>
      <Shape>
        <Appearance>
          <Material/>
        </Appearance>
        <ElevationGrid DEF='_16'
            xDimension='3'
            zDimension='3'
            xSpacing='1.01429'
            height='0, 0, 0, 0.0837725, 0.256958, 0, 0, 0.0837725, 2'/>
      </Shape>
    </Transform>
    <Transform DEF='ElevationGrid124Trafo'
        translation='-0.998064 0 -0.998064'>
      <Shape>
        <Appearance>
          <Material/>
        </Appearance>
        <IndexedFaceSet USE='_2'/>
      </Shape>
    </Transform>
    <Script DEF='IFSy2Height'>
      <field accessType='inputOnly' type='MFVec3f' name='set_point'/>
      <field accessType='outputOnly' type='MFFloat' name='height_changed'/>
<![CDATA[ecmascript:

function initialize ()
{
	
}

function set_point (value, time)
{
  print (value);
  //var heightArray = new MFFloat();
  for ( var i = 0; i < value.length; i++ ) {
    height_changed[i] = value[i]. y;
    }

  //height_changed = heightArray;
  print (height_changed);
}

//function eventsProcessed ()
//{
//	
//}
]]>
    </Script>
    <ROUTE fromNode='_3' fromField='point_changed' toNode='IFSy2Height' toField='set_point'/>
    <ROUTE fromNode='IFSy2Height' fromField='height_changed' toNode='_16' toField='set_height'/>
  </Scene>
</X3D>
@andreasplesch
Copy link
Author

Just as a side note, having IndexedFaceSet as a field value of MetadataSet is not really supported by the spec. Only values of X3DMetadataObject type would be allowed. But it is a nice mechanism for reuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant