[x3d-public] Can this be added in X3DJSAIL? Looks like setUrl could take a string array

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Thu Apr 11 00:11:51 PDT 2019


setUrl can accept ArrayList<String>, MFStringObject, SFStringObject String or String[] as inputs.  Similarly for addUrl() method.

Please see
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Texturing/ImageTextureObject.html

for setUrl(String[])
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Texturing/ImageTextureObject.html#setUrl-java.lang.String:A-

so it looks like your invocation syntax might be incorrect.

Java: how to initialize String[]?
    https://stackoverflow.com/questions/2564298/java-how-to-initialize-string
then example
    String[] args = new String[]{"firstarg", "secondarg", "thirdarg"};

so your Java invocation

	.setUrl(["../KelpForestExhibit/KelpForestMain.x3d","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.x3d","../KelpForestExhibit/KelpForestMain.wrl","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.wrl"])

should be

	.setUrl(new String[]{"../KelpForestExhibit/KelpForestMain.x3d","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.x3d","../KelpForestExhibit/KelpForestMain.wrl","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.wrl"})

I just tried something like that on HelloWorld.java and the syntax is OK.

Not sure what the Python syntax is for string array, please check further.  Perhaps further trickery will be needed on your python -> Java mapping.




On 4/9/2019 9:02 PM, John Carlson wrote:
> processSingleScene.pythonValidation:
> 
>       [echo] processSingleScene.python C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter03Grouping\InlineKelpForest.future.py
> 
>       [echo] Loading X3D model as .py program, if successful then saving as round-trip .x3d version:
> 
>       [exec] Traceback (most recent call last):
> 
>       [exec]   File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter03Grouping\InlineKelpForest.future.py", line 76, in <module>
> 
>       [exec]     .setUrl(["../KelpForestExhibit/KelpForestMain.x3d","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.x3d","../KelpForestExhibit/KelpForestMain.wrl","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.wrl"]) \
> 
>       [exec]   File "jnius\jnius_export_class.pxi", line 760, in jnius.JavaMethod.__call__
> 
>       [exec]   File "jnius\jnius_conversion.pxi", line 78, in jnius.populate_args
> 
>       [exec]   File "jnius\jnius_utils.pxi", line 205, in jnius.check_assignable_from
> 
>       [exec] jnius.JavaException: Invalid instance of 'org/web3d/x3d/sai/Networking/X3DUrlObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'
> 
>       [exec] Result: 1
> 
>       [echo] =====================
> 


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 http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list