Announcement

Collapse
No announcement yet.

Getting/Setting the UI parameter "targeted" of a VRayPhysicalCamera

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting/Setting the UI parameter "targeted" of a VRayPhysicalCamera

    I have an INode object which is a camera node shown as a VRayPhysicalCamera in the 3ds Max user Interface.

    I want to set the boolean parameter "targeted" as shown in the user interface.

    How can I do this using the SDK starting from the INode object?

    Regards,
    Ralf

  • #2
    Something like this should work:
    Code:
    enum VRayCameraParams {
      pb_targeted=8
    };
    
    INode *node=...;
    Object* obj=node->GetObjectRef()->FindBaseObject();
    IParamBlock2 *pblock=obj->GetParamBlock(0);
    if (pblock) {
      pblock->SetInt(pb_targeted, 0, TRUE);
    }
    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      This code isn't building with the 3ds max 2014 SDK.

      There is no function Object::GetParamBlock(int). There is a function Object::GetParamBlock() but this returns NULL.

      How can I get this to work?

      Best regards,
      Ralf Reichl

      Comment


      • #4
        There's probably some other param block function, I don't have the Max SDK in front of me right now. It might have been GetParamBlockByID() or something like that.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          There are exactly two functions in Object:

          IParamArray * Object::GetParamBlock() which returns NULL

          and

          int GetParamBlockIndex(int id) which only returns an "int".

          So it is not clear how to make your code work?

          I am relying on your help. I also haven't find any hint in the documentation.

          Best regards,
          Ralf Reichl

          Comment


          • #6
            class Object derives from other classes (like Animatable), they have their own methods too. The 3ds Max SDK is located online here:
            http://usa.autodesk.com/adsk/servlet...12&id=23015025

            It's good to have it as reference anyways, as you will almost certainly need it.

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment


            • #7
              I have found the function GetParamBlockByID as you have suggested. Sorry for that. For some unknown reasons I couldn't find it at first.

              Please see my partial code below.

              I have tried for id the values 0, VRayLights::vrayLight_params.

              I have tried for paramid the values 8 and VRayLights:b_targeted.

              But all values in any combination doesn't yield the correct result and doesn't seem to work properly.

              Using VRayLights seems to be wrong anyway because it should be for lights only.

              There is no

              enum VRayCameraParams {
              pb_targeted=8
              };

              as you described below.


              What should I use for id and paramid in my code below?


              short id= ???

              IParamBlock2 * pblock = object->GetParamBlockByID(id);

              short paramid = ???

              bool value = pblock->GetInt(pb_paramid)

              Best regards,
              Ralf Reichl

              Comment


              • #8
                Can you please tell me which id I have to use in Object::GetParamBlockByID and which id I have to use in IParamBlock2::GetInt to get the "targeted" parameter of a VRayPhysicalCamera?

                I couldn't find anything in the documentation about this?

                Thanks.

                Best regards,
                Ralf Reichl

                Comment


                • #9
                  Hi Vlado,

                  I am relying on your help to solve this issue because the documentation and the source code doesn't help me on this.

                  Thanks a lot.

                  Best regards,
                  Ralf Reichl

                  Comment

                  Working...
                  X