cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Extension development - enable dragger?

ClayHelberg
17-Peridot

Extension development - enable dragger?

I have been doing some extension development, and have had pretty good success with it. But I'm struggling with one thing: I am trying to develop a 3D widget, with the usual x, y, z, rx, ry, rz properties to position it. The runtime preview respects these attributes as expected, but the design time view has a few issues:

  1. The values appear to be applied twice in the design canvas, e.g. if I set x=0.1, the widget is rendered at x=0.2. If I rotate by 30 degrees, the widget is rendered rotated 60 degrees
  2. The widget shows the dragger (translate/rotate) control in the design view, and I can use it to apply translations/rotations to the rendered widget, but those changes don't update the widget's location properties. For example, I can drag the widget "up" on the Y axis, and it moves as expected on the design canvas, but the Y property value doesn't change (nor do any other properties change).
  3. Clicking the widget in the design canvas highlghts the rendered widget, but doesn't select it in the tree view. To fully activate the widget, you have to select it in the tree view.

I suspect items 2 & 3 are related.

 

So I guess I've left something out of my design JS file, but I'm not sure what I need to make the design canvas work the way it's supposed to. I've been using some of the OCTO extensions as a guide, particularly the Progress-3D widget.

 

Can anyone give me some tips on how to make sure the positioning functions in the design canvas work with my extension? @SteveGhee or @RolandRaytchev or @sgreywilson maybe?

9 REPLIES 9

Hi @ClayHelberg ,

I had in the past some attempts to use widget extensions where I noticed that some coordinates in 3d space are not corrected interpreted -but there I adapted the value so that it was working without further check what is the reason for such behavior. The specific  behavior was different depending on the particular  implementation, I believe. To understand the problem , possibly it will be helpful if there is an example which demonstrate the issue. You mentioned that it is based on  specific extension progress-3d of the OCTO Extensions, but to be sure that we speak about the same thing , it will be better to have an example (simplified only to the relevant problem). Because I my self did not have so much experience with developments of extension - 3D so  need to check more detailed and if required to ask the R&D team for further assistance. Thanks BR. 

Hi @RolandRaytchev , thanks for the reply. I will attach a copy of my extension for troubleshooting.

Another update: I figured out the double-parameters issue in the design view: my design template has a <twx-dt-image> element, and I was passing the widget parameter values into that, but that meant that the parameters were applied on both the widget wrapper and the rendered image. I modified it to set the <twx-dt-image> parameters to 0, and now the positioning based on parameter values works as expected.

Still haven't cracked the other two issues though. In the design view, when I click on the extension widget instance on the design canvas, I see this error:

 

TypeError: ctrlWidget.select is not a function

 

The rendered widget seems to be some kind of derived object that's not a "real" widget--if I use the debugger tools to examine ctrlWidget, I see this:

 

ClayHelberg_0-1700149492142.png

So maybe there's something I need to be doing in the design JS to make sure the <twx-dt-image> has a proper controller?

Hi @ClayHelberg 

I tested it and I have the same problems reproduced, so it seems that there are many issues. So I tried to check the extension from OCTO GitHub Progress-3D widget  , what you mentioned that was taken as start template for your  widget and it was not working  in eyewear project. when I tested - possibly the version or some specific setting is required .. no idea

I checked if there is other source with simple 3D extension and think this one is simple and work fine ->open source Extensions  for Vuforia Studio at GitHub repository

In this github repository there are several 3D extensions defined which does not use to much code but are relative simple. - e.g. tmlSVG see also 

2023-11-16_22-56-54.jpg

I think this extension uses some 3Dproperty as template and how it is designed make e.g. for me more easy to understand and customize it later - TMLSVG.design.js and 3dsvg.js

attached here the project where I tested this extension.

Hi Roland--

 

Do those SVG extensions work for you, especially using the dragger to move them and see the location parameters update? They don't work for me--I get the same errors with these that I am getting with my own extension. The dragger controls *seem* to work, but they don't actually update the location parameters. I tested with my own (new) experience and also the one you posted above.

rr_svg_extension.gif

Hi Clay--,

thanks for  the  clarification! OK , i think now understood the issue your reported ...  but still have no idea about a possible solution. Therefore reported the problem to PTC R&D team as Ticket VTS-1783 and when there is a feedback I will share it there. I also mentioned in the ticket report the community topic  so that possibly someone from the R&D team will directly joint to this post . Thank you!

Thanks @RolandRaytchev !

Hi @ClayHelberg  the issue in ticket Ticket VTS-1783  was idetified as bug and R&D will fix it. This functionality is not working generally for extensions. So accroding to the code of the extension it should be correct and should work when a fix is availible. currnetly is no info when the fix is planed (datecode)  - there is only an info that R&D is working on the problem.

Thanks for the update @RolandRaytchev ! I'll watch for it in upcoming releases.

Top Tags