I'm confused with nodes...

I’ll add more from the practical side :wink:

  1. When you create node, eg. x = NodePath(‘something’), what does (‘something’) do?
    It doesn’t do much, it’s basically the name of the newly created PandaNode (wrapped into a NodePath).
    It’s useful if you want to search the scene graph using .find(), but you should always give some name because doing x = NodePath() gives you a NodePath pointing to well …nothing at all. x = NodePath(‘something’) gives you an empty bucket, x = NodePath() gives you no bucket (and before you ask,no there are no buckets in p3d, just trying to make it graphical).

  2. are SpotLight(’’), PointLight(’’) nodes?
    Yes and No. Lights are PandaNodes (they inherit from PandaNode) but are not NodePaths.
    You may want to look here:
    panda3d.org/reference/1.8.1/ … daNode.php
    and here:
    panda3d.org/reference/1.8.1/ … dePath.php
    To compare what you can do with a PandaNode and what you can do with a NodePath.

  3. What does " node() " do? (eg. base.cam.node())
    The thing about NodePaths is that you can wrap a PandaNode (or anything that inherits from it) into a NodePath, so you get a PandaNode inside a NodePath and .node() allows you to access th methods of the PandaNode inside.

  4. What’s the difference between these two?
    The code:

thing = render.attachNewNode('something')

is a short way to write:

 
thing = NodePath('something')
thing.reparentTo(render)