<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Yes agreed completely - that is exactly what I was trying to express.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Simply use x3d.py to help support your work with Maya.</div>
<div id="Signature" class="elementToProof">
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;"><br>
</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;">all the best, Don</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;">--</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;">Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman@nps.edu</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;">X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Courier New"; font-size: 9pt;"> </span></p>
</div>
<div id="appendonsend"></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> x3d-public <x3d-public-bounces@web3d.org> on behalf of Bergstrom, Aaron via x3d-public <x3d-public@web3d.org><br>
<b>Sent:</b> Wednesday, January 15, 2025 9:38 AM<br>
<b>To:</b> Extensible 3D (X3D) Graphics public discussion <x3d-public@web3d.org><br>
<b>Cc:</b> Bergstrom, Aaron <aaron.bergstrom@und.edu><br>
<b>Subject:</b> Re: [x3d-public] Question about a Python and x3d.py Error message</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:"Segoe UI Emoji"}
@font-face
        {font-family:Aptos}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
p.x_elementtoproof, li.x_elementtoproof, div.x_elementtoproof
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
span.x_EmailStyle22
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style>
<div lang="EN-US" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal">Don,</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">You should think of it as me extending Maya functionality, not me extending x3d.py functionality.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Unfortunately, the fancy schmantzy code I’m writing for Maya requires me to add x3d.py functionality to Maya nodes so I can do fancy GUI-based X3D Route creation in the Maya Node Editor.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Not planning on changing anything about x3d.py, I just want to add x3d.py functionality to Maya nodes.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Aaron</p>
<p class="x_MsoNormal"> </p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal"><b>From:</b> Brutzman, Donald (Don) (CIV) <brutzman@nps.edu>
<br>
<b>Sent:</b> Wednesday, January 15, 2025 11:25 AM<br>
<b>To:</b> Extensible 3D (X3D) Graphics public discussion <x3d-public@web3d.org><br>
<b>Cc:</b> Bergstrom, Aaron <aaron.bergstrom@und.edu><br>
<b>Subject:</b> Re: [x3d-public] Question about a Python and x3d.py Error message</p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black">Hey guys, "please don't go there."  You should never need to poke around with __init__ or inheritance or any of that internal stuff.  Those code patterns are autogenerated, so you don't have
 to do any of that.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black">Just build a scene graph.  The vocabulary is simply X3D.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black">Corrolary:   "creativity is punished"   </span><span style="font-family:"Segoe UI Emoji",sans-serif; color:black">😨</span><span style="font-family:Aptos; color:black"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div id="x_Signature">
<p><span style="font-size:9.0pt; font-family:"Courier New"">all the best, Don</span></p>
<p><span style="font-size:9.0pt; font-family:"Courier New"">--</span></p>
<p><span style="font-size:9.0pt; font-family:"Courier New"">Don Brutzman  Naval Postgraduate School, Code USW/Br       
<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a></span></p>
<p><span style="font-size:9.0pt; font-family:"Courier New"">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149</span></p>
<p><span style="font-size:9.0pt; font-family:"Courier New"">X3D graphics, virtual worlds, navy robotics
<a href="https://faculty.nps.edu/brutzman" data-auth="NotApplicable">https://faculty.nps.edu/brutzman</a></span></p>
<p><span style="font-size:9.0pt; font-family:"Courier New""> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:Aptos; color:black"> </span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> x3d-public <<a href="mailto:x3d-public-bounces@web3d.org">x3d-public-bounces@web3d.org</a>> on behalf of Bergstrom, Aaron via x3d-public <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>
<b>Sent:</b> Wednesday, January 15, 2025 9:03 AM<br>
<b>To:</b> Extensible 3D (X3D) Graphics public discussion <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>
<b>Cc:</b> Bergstrom, Aaron <<a href="mailto:aaron.bergstrom@und.edu">aaron.bergstrom@und.edu</a>><br>
<b>Subject:</b> Re: [x3d-public] Question about a Python and x3d.py Error message</span>
</p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<p>Apparently, I’m a bit out of my depth when it comes to multi class inheritance. Not really a good tutorial out there for mixing inheritance from Maya python classes and other classes. I’m getting another error now.</p>
<p>“'X3DScene' object has no attribute '_Scene__children'”</p>
<p> </p>
<p class="x_elementtoproof">Looking up similar errors in Google basically tells me I’m not calling the inherited classes __init__ methods.</p>
<p> </p>
<p>I’ll have to do some more digging.</p>
<p> </p>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p><b>From:</b> John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>><br>
<b>Sent:</b> Wednesday, January 15, 2025 10:52 AM<br>
<b>To:</b> Extensible 3D (X3D) Graphics public discussion <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>
<b>Cc:</b> Bergstrom, Aaron <<a href="mailto:aaron.bergstrom@und.edu">aaron.bergstrom@und.edu</a>><br>
<b>Subject:</b> Re: [x3d-public] Question about a Python and x3d.py Error message</p>
</div>
<p> </p>
<p>self is the first parameter to instance methods.  I don’t know about class methods.  My guess is you might want instance methods, but it’s your design.</p>
<p> </p>
<p>On Wed, Jan 15, 2025 at 10:37 AM Bergstrom, Aaron via x3d-public <<u><span style="color:blue"><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a></span></u>> wrote:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p>John,</p>
<p> </p>
<p>Thanks for responding.</p>
<p> </p>
<p>So in the case of the code below, would the instance method be the “def creator(cls):” method? If so, would I think do the following: “def creator(cls, self):”</p>
<p> </p>
<p>Or am I not understanding what you are saying?</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p>Aaron</p>
<p> </p>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p><b>From:</b> John Carlson <<u><span style="color:blue"><a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a></span></u>><br>
<b>Sent:</b> Wednesday, January 15, 2025 10:12 AM<br>
<b>To:</b> Extensible 3D (X3D) Graphics public discussion <<u><span style="color:blue"><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a></span></u>><br>
<b>Cc:</b> Bergstrom, Aaron <<u><span style="color:blue"><a href="mailto:aaron.bergstrom@und.edu">aaron.bergstrom@und.edu</a></span></u>><br>
<b>Subject:</b> Re: [x3d-public] Question about a Python and x3d.py Error message</p>
</div>
<p> </p>
<p>Aaron, AFAIK, you need “self” as the first parameter in your instance methods (not functions, of course).  I don’t know about class methods.</p>
<p> </p>
<p>If you’re familiar with Java or C++, this is similar to “this”.</p>
<p> </p>
<p>On Wed, Jan 15, 2025 at 10:02 AM Bergstrom, Aaron via x3d-public <<u><span style="color:blue"><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a></span></u>> wrote:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p>I need help troubleshooting a x3d.py error message.</p>
<p> </p>
<p>In developing a Python version of the Rawkee X3D exporter plugin for Maya, I am attempting to create nodes that inherit from both the Maya Python API 2.0 and x3d.py</p>
<p> </p>
<p>As such, I have a question about python and multiple class inheritance, and an error I am seeing. Admittedly, I am not the strongest Python programmer.</p>
<p> </p>
<p>I am getting the following error when I execute the Python code in Maya, and I’m pretty sure I do not of the __init__() function setup correctly.</p>
<p> </p>
<p># Error: TypeError: file C:\Users\<u><span style="color:blue"><a href="http://user.name/" data-auth="Verified" originalsrc="http://user.name/" shash="ku8xbQBzCnuDRT9uaykj4uK/MWzEk3stJ9whVJTu5+UVU88fOp/H0v2+y8jGXnFIgUJBtbmaQGdSmcT3gHtg4FmQFsYprYPAYXvfdj66iZhsT8f+acSzgStoD1jB/Uc0fYZhfhs4fb4+rQY2o1WZCwl6jtuYm4ClQdZHR8CqJ74=">user.name</a></span></u>\AppData\Roaming\Python\Python311\site-packages\x3d\x3d.py
 line 14984: Scene.hasChild() missing 1 required positional argument: 'self' #</p>
<p> </p>
<p>Can anyone with some Python experience give me an idea of what I am doing wrong here?</p>
<p> </p>
<p>Here is the code:</p>
<p>#################################################################</p>
<p>import x3d</p>
<p> </p>
<p>import maya.api.OpenMaya as aom</p>
<p>import maya.api.OpenMayaUI as aomui</p>
<p>import maya.api.OpenMayaRender as aomr</p>
<p> </p>
<p># import xmltodict</p>
<p># import json</p>
<p> </p>
<p>class X3DScene (aom.MPxNode, x3d.Scene):</p>
<p>    TYPE_NAME    = "Scene"</p>
<p>    TYPE_ID      = aom.MTypeId(0x00108FFF)</p>
<p>    PROFILE_TYPE = "Full"</p>
<p>    VERSION      = "4.0"</p>
<p> </p>
<p>    def __init__(self):</p>
<p>        super(X3DScene, self).__init__()</p>
<p>       </p>
<p>    @classmethod</p>
<p>    def creator(cls):</p>
<p>        return X3DScene()</p>
<p>       </p>
<p>    @classmethod</p>
<p>    def initialize(cls):</p>
<p>        cls.x3dDoc = x3d.X3D(profile=cls.PROFILE_TYPE, version=cls.VERSION)</p>
<p>        cls.x3dDoc.Scene = cls</p>
<p>        #######################################################</p>
<p>        # Test dump to make sure the class works as expected</p>
<p>        #print(json.dumps(xmltodict.parse(cls.x3dDoc.XML()), indent=4))</p>
<p>        print(cls.x3dDoc.XML())</p>
<p>_______________________________________________<br>
x3d-public mailing list<br>
<u><span style="color:blue"><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a></span></u><br>
<u><span style="color:blue"><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" data-auth="NotApplicable">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></span></u></p>
</blockquote>
<p>_______________________________________________<br>
x3d-public mailing list<br>
<u><span style="color:blue"><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a></span></u><br>
<u><span style="color:blue"><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" data-auth="NotApplicable">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></span></u></p>
</blockquote>
</div>
</div>
</body>
</html>