0

"View -> No Correction" Differences between RV3 and RV4?

Hey all,

When we apply our color treatment we turn off all the "Linear to Display Correction" options in the View menu, as our LUT handles eveyrthing we need.

In RV 3 we had some basic code that seemed to work fine:

rvc.readLUT(self.lutPath,colorNode)
rvc.setIntProperty("%s.lut.active" % colorNode, [1],True)
rvc.setIntProperty("%s.color.logtype" % colorNode, [0],True)
rvc.setIntProperty("%s.color.Rec709ToLinear" % colorNode, [0],True)
rvc.setIntProperty("%s.color.sRGB2linear" % colorNode, [0],True)

But now in RV4 this doesn't seem to be working.  The View menu option sRGB seems to be staying applied.  In transitioning from RV3 tro RV4 we changed the node name from #RVColor to #RVLinearize and that fixed the errors we were getting.  Now we don't get any errors, but the sRGB option remains on, which messes the color.

Any ideas what i'm doing wrong here?

 

22 comments

  • 0
    Avatar
    Jon Morley

    Hi John,

    I think you will find it is better to call the rvui methods from your code then to set these properties directly. That will be the most future proof way to handle disabling conversions since it will be left up to us to keep rvui up to date. Have you tried calling the following Mu statement:

    rvui.setDispConvert("")(nil);

    If you need to call that from Python you should be able to call:

    from rv import runtime

    runtime.eval('rvui.setDispConvert("")(nil);',[])

    Please let me know if that does not work for you.

    Thanks,
    Jon

  • 0
    Avatar
    John Vanderbeck

    Hi Jon,

    I guess the answer is that we didn't know there was a better way to do this :)  Our code is all Python and honestly built byu learning as we went, just trying things until they worked lol.

    I'll try your suggestion after lunch.

  • 0
    Avatar
    Jon Morley

    Hi John,

    That is awesome that you made it this far. It is hard to discover all of the methods that are out there, but you can always look at rvui.mu in the plugin/Mu directory of your RV install to see what every menu option does. Sometimes there is more information in the Help -> "Mu Commands API Broswer…"

    Let me know how it goes!

    Thanks,
    Jon

  • 0
    Avatar
    Jon Morley

    Hi John,

    I think I charged off too fast here. Your subject sounds like you are looking for a way to turn off correction on the view, but then your sample code seems to be all about the source.

    I kinda wanted to start over here and point out first the porting guide for moving RV-3 code forward to RV-4:

    http://tweaksoftware.com/static/documentation/rv/current/html/rv_3to4_porting_guide.html

    You should definitely take a look at that before going much further in either case (display or source). And then it sounds like you might be looking to make your own additions to the source setup step when RV loads a clip. I will wait to hear back from you to get the specifics, but here is the relevant documentation for that part of RV:

    12.3 Breakdown of sourceSetup() in the source_setup Package

    After you have a chance to look this all over please let me know how to best help next.

    Thanks,
    Jon

     

  • 0
    Avatar
    John Vanderbeck

    Hey Jon,

    The code in source_Setup.py looks to be doing essentially the same thing we are, so i'm not sure why ours is failing to turn off the various transfer types, while that code is.

    Am I misunderstanding what i'm looking at? is:

    rvc.setIntProperty("%s.color.sRGB2linear" % colorNode, [0],True)

    Not setting the View-> sRGB option OFF?

  • 0
    Avatar
    Jon Morley

    Hi John,

    It is entirely possible that you are calling your code before the regular source setup so it stomps on your settings. Can you please tell me which event you are using?

    I am not sure if you saw it in the Porting Guide but the event that source setup triggers from in RV-4 has changed to "source-group-complete" from the "new-source" in RV-3.

    Please let me know.

    Thanks,
    Jon

  • 0
    Avatar
    Jon Morley

    Hi John,

    Sorry to skip over your question. That code snippet you share deals only with a source and not the view. If you are really trying to set the view to "No Correction" then you will be targeting the sRGB property of "@RVDisplayColor.color.sRGB".

    Thanks,
    Jon

  • 0
    Avatar
    John Vanderbeck

    Hi Jon,

    Your comment about the changes from "new-source" to "source-group-complete" is probably the most relevant.  I indeed did not notice this change.  We are currently working off new-source.

    I will be looking into this as soon as I have some more free time and thank you for your insight.

  • 0
    Avatar
    Jon Morley

    Ok John,

    That makes sense. Please keep us posted.

    Thanks,
    Jon

  • 0
    Avatar
    John Vanderbeck

    Hi Jon,

    I finally found time to circle back around to this as porting to RV4 has become a huge priority for us.

    I've changed our code over to use the "source-group-complete" event, rather than "new-source", but that is causing me another problem.  

    In the past we parsed the contents of event.contents() to get the full path to the sequence being loaded.  However in the new event that information doesn't seem to be available.  So I tried to use another method we had used in the past to determine the sequence:

    types = rvc.getCurrentAttributes()
    print types
    path = None

    if types:
        for t in types:
            if str(t[0]) == "Sequence":
                path = str(t[1])
                break

     

    But this isn't working either.  rvc.getCurrentAttributes() is returning None.

    I need the full path to the sequence or none of the rest of our code will work.

  • 0
    Avatar
    John Vanderbeck

    I just noticed that getCurrentAttributes is deprecated.  I changed the code to use sourceAttributes instead, but it also returned None :(

  • 0
    Avatar
    John Vanderbeck

    In fact nothing I try works.  Its almost like the source string i'm given from the event doesn't work in anything.

  • 0
    Avatar
    John Vanderbeck

    Hey Jon,

    It appears that the problem i'm having is every call I make to extra_commands.associatedNode() is returning a blank string back.  If I manually build my own node name instead, such as turning "sourceGroup000000" into "sourceGroup000000_source" which of course is bad, then the rest of my code works.

    Any ideas why associatedNode would not be working?

  • 0
    Avatar
    Alan Trombla

    Hi John,

    The string in the contents() of the source-group-complete is the name of the SourceGroup node.  The node name you give to sourceAttributes is the name of the FileSource node which is a sub-node of the group.  If you refer to the distributed color configuration code (source_setup.py), you'll see how it pulls apart the contents of the event and calls sourceAttributes().  In particular, look for these lines:

    args = event.contents().split(";;")
    group = args[0]
    fileSource = groupMemberOfType(group, "RVFileSource")
    ... fileNames = commands.getStringProperty("%s.media.movie" % source, 0, 1000)
    fileName = fileNames[0] ... srcAttrs = commands.sourceAttributes(source, fileName)

    (Note that the "groupMemberOfType" utility function is also defined in source_setup.py.)

    Hope that helps,

    Alan

  • 0
    Avatar
    John Vanderbeck

    So should I be using groupMemberOfType() now instead of AssociatedNode() which is what I was using with the old event?

  • 0
    Avatar
    John Vanderbeck

    Ok so that makes the source node part work.

    I tried using groupMemberOfType() for looking up the proper #RVColor and #RVLinearize nodes, but that isn't working.  Need to do more digging.

    I feel like i'm so close to getting this to work, but its just out of my grasp

  • 0
    Avatar
    John Vanderbeck

    Ahh I see my mistake.  I was using the # format of associatedNode

  • 0
    Avatar
    Alan Trombla

    Hi John,

    So should I be using groupMemberOfType() now instead of AssociatedNode() which is what I was using with the old event?

    They're just different.  If you can tell me what the particular case is, I can tell you which one to use.  The groupMemberOfType() function finds a member node of a given type, in a given group node.  The associatedNode function walks the DAG in the evaluation direction to find nodes.

    Certainly in the example I listed above, you can't use associatedNode to find a FileSource in a SourceGroup (because associatedNode walks the DAG in the other direction).

    I think the bottom line is that source_setup.py is the model you should use for color management in RV4.

    Cheers,

    Alan

  • 0
    Avatar
    John Vanderbeck

    Yeah I keep referencing source_Setup, but you have to understand our priority right now it the path of least resistance to get our old code working in RV4, not a complete re-write until later.  The example source_setup is VERY different than what we are doing, so i'm taking what I can learn from it and figuring out the rest.

    I understand now the difference between the nodes, so i'm a bit more clear on that.

    Like I Said i'm very close, so i'm just trying to get these last pieces to work.

  • 0
    Avatar
    Alan Trombla

    OK, cool.  Just let us know if you have more questions.

    Alan

  • 0
    Avatar
    John Vanderbeck

    "OK, cool.  Just let us know if you have more questions."

    Careful opening that can of worms Alan :D

    I think I finally have it all working, but I have one concern due to the changes from "new-source" to "source-group-complete", doesn't that mean i'm now dealing with an entire group of clips, rather than on individual one?

    Our old system dealt with "new-source" and set up the LUT and color options for each clip individually.  For example, what if different clips in that group need different LUTS?

    Anyway i'm super happy I have it at least working, now I need to research how the code needs to change sop that each individual source is processed properly on its own.  Its probably something simple, but like I Said our code was designed for a different source event, so that is making it trickier.

  • 0
    Avatar
    Alan Trombla

    I think I finally have it all working, but I have one concern due to the changes from "new-source" to "source-group-complete", doesn't that mean i'm now dealing with an entire group of clips, rather than on individual one?

    No, you'll get one source-group-complete event per source loaded.  The confusion arises from the fact that almost all the "nodes" you see listed in the Session Manager are actually groups of nodes.  For example a SourceGroup contains the FileSource (the node that actually holds the name of the media file, etc) but also nodes to linearize, cache, re-format, color-adjust, etc the pixels provided by the FileSource.

    This is all described in more detail in the Reference Manual chapter on the IP Graph:

    http://www.tweaksoftware.com/static/documentation/rv/current/html/rv_reference.html#Chapter_2_Image_Processing_Graph

    Hope that clarifies,

    Alan

Please sign in to leave a comment.