Locate a node with a particular Name

I have a complex scene with a lot of objects in it. One of those objects apparently has the name "Camera"

Note that I specifically mean name here, not the label that is visible in the scene tab tree. As far as I can tell, the only way to see the name is to select the node and go to Scene Identification. Other than that, the name appears to be entirely invisible.

The reason this matters is that every time I add a camera to the scene, the name it suggests for the new camera is "Camera," and then it complains that there's alreay a node named camera in the scene! Well, OK Daz, what do you expect me to do about it?

I've looked at all the nodes that seem likely to have that name, but none of them do. Is there a way to search for it? The filter on the scene tab only seems to work on labels.

Comments

  • mrpenguin76mrpenguin76 Posts: 94
    edited May 17

    What I would do in a situation like this is save the Scene file to a TEMP location, and make sure to save it out UNCOMPRESSED. Then open the Scene file with either Note Pad or Note Pad++ and CTRL+ F "Camera". To find the name, which should then tell you the "Label" for the node that is named Camera. Depending on how complex your scene is, it will be much faster to track it down this way.  Once you do identify it, you may need to edit its .dsf file in it's data folder to actually correct the issue, otherwise, simply changing the Node name in your scene, is going to lock that "FIX" into that scene only when you change its name from Camera in Scene Identification.

    Post edited by mrpenguin76 on
  • Richard HaseltineRichard Haseltine Posts: 110,167
    edited May 17

    This will work for a node literally named "Camera", or whatever you edit that to. It will select the node if it finds it, otherwise it will do nothing - it doesn't deselect anything else.

    var oNode = Scene.findNode( "Camera" );
    if ( oNode ) {
    	oNode.select( true );
    }
    

    just paste it into the ScriptIDE pane, edit the node name as desired, and click Execute at top-right of the pane.

    Post edited by Richard Haseltine on
  • chris-2599934chris-2599934 Posts: 1,941
    edited May 17

    Thanks guys, I came up with a solution similar to mrpenguin76's:

    Save the scene file uncompressed and open in in Notepad. A search revealed that the problem is one of the bones of the camera prop in this set. There doesn't appear to be a way to edit this, or even view it using the Daz UI. If you select that bone and choose Scene Identification, you just see the properties of the whole prop, not the bone.

    My work around, without editing the duf file and closing and reopening the scene (because it's a big scene and that could take an hour or so) was this:

    • Save the camera prop as a scene subset, then delete it from the scene.
    • Create a new camera, using the default name of "camera." Yay! No error message!
    • Merge the camera prop back into the scene from the subset file. Now it's the camera bone that has the duplicate name, and Daz just quietly gives it a new one without hassling me about it.

    I may yet try editing the dsf file to stop this from happening in the future, but for now I've fixed it.

    Frankly, I don't see why nodes have to have both a name and a label, both of which must be unique within the scene, why not just have one or the other? Nor why they can't make it automatically suggest a name that doesn't duplicate an existing node.

    Post edited by chris-2599934 on
  • chris-2599934chris-2599934 Posts: 1,941

    [POST SCRIPT]

    I'm wrong.

    It doesn't rename the bone when I merge the camera in from the subset, it just doesn't care that a bone has the same name as another objec in the scene. But it does care if a new object is given the same name as that bone. So I'll have to do the dsf thing if I want to avoid this in the future. 

  • There's a simple solution to this problem, load a default camera on "new"

    Edit>Preferences(F2)>Scene>Create a "Default Camera".

    This will load, but not set to the view of, a camera on startup or on selecting new from the FIle menu(Ctrl+N)

     

Sign In or Register to comment.