Signal activeCameraChanged() not working

Evelyn MccallEvelyn Mccall Posts: 13

Hi,

I have an issue with a signal of Dz3dViewPort. 
I am not receiving the signal activeCameraChanged().

DAZ Studio shows an error in the log file: WARNING: Object::connect: No such signal Dz3DViewport::activeCameraChanged(DzCamera *cam)

connect(my3dViewPort, SIGNAL(activeCameraChanged(DzCamera *cam)), this, SLOT(activeCamChanged(DzCamera *cam)));

 

If I try a different signal like viewChanged() to trigger my slot, it works.

connect(my3dViewPort, SIGNAL(viewChanged()), this, SLOT(activeCamChanged()));

 

Here's the part of the "dz3dviewport.h" header file:

//dz3dviewport.hsignals:	void	activeCameraChanged( DzCamera *cam );	void	dimensionsChanged();	void	viewChanged();

 

What am I doing wrong here, any idea?

I want to get informed, when the user switches to a different camera.

Post edited by Evelyn Mccall on

Comments

  • If I try using it in Script IDE it works:

    connect(my3dViewPort, 'activeCameraChanged(DzCamera*)',  function(cam) {    print("Swapping to " + cam.getName() + "...")    });

    Now I am even more confused.

  • Look closely at the differences between the script version and the C++ version. In the C++ version you include the parameter identifier but in the script version you do not - the script version has the correct signature, which is why it works and the C++ version does not. Function signatures passed to the SIGNAL/SLOT macros are converted to strings at runtime and the connection is established (or not) based on string matching operations. During these matching operations, parameter names are not relevant - only type and order matter. Further, the inclusion of space characters except to separate keywords from type identifiers cause the matching process to be less efficient, as the first attempt to (exactly) match will fail and then a normalized version of the signatures will be attempted.

  • Thanks a million. I never thought that I can't use the parameter identifiers. It works now.

    connect(my3dViewPort, SIGNAL(activeCameraChanged( DzCamera * )), this, SLOT(activeCamChanged( DzCamera * )));

     

Sign In or Register to comment.