# Documentation on some key RV python functions

**URL:** <https://community.shotgridsoftware.com/t/documentation-on-some-key-rv-python-functions/11706>\
**Category:** RV\
**Tags:** python\
**Created:** [March 1, 2021, 10:13am UTC](https://community.shotgridsoftware.com/t/documentation-on-some-key-rv-python-functions/11706 "2021-03-01T10:13:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabian](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/fabian/32/3508_2.png) [@Fabian](https://community.shotgridsoftware.com/u/Fabian)\
**Post date:** [March 1, 2021, 10:13am UTC](https://community.shotgridsoftware.com/t/documentation-on-some-key-rv-python-functions/11706/1 "2021-03-01T10:13:09Z")

</div>

Hi everyone!

I would like to know how some key python functions behave, what their input parameters do and what their return values are.

```auto
from rv import commands

commands.setIntProperty(node + '.' + prop, [value], True)
commands.getIntProperty(node + '.' + prop, 0, 1)[0]
commands.setFloatProperty(node + '.' + prop, [value], True)
commands.getFloatProperty(node + '.' + prop, 0, 1)[0]
commands.setStringProperty(node + '.' + prop, [value], True)
commands.getStringProperty(node + '.' + prop, 0, 1)[0]

```

Here are my questions:

1. How are the 2 additional parameters in the “getter” functions defined? What do they do? What is their type?
2. Do the “getter” functions always return lists?
3. Do the values always have to be given as a list in the “setter” functions?
4. What does the 3rd parameter mean in the “setter” functions?
5. Are there any additional parameters to these functions?
6. Are there any resources online to learn more about the RV python libraries?

Thanks in advance!

Cheers,  
Fabian

---

<div class="post-metadata">

**Author:** ![collinbanko](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/collinbanko/32/774_2.png) [@collinbanko](https://community.shotgridsoftware.com/u/collinbanko)\
**Post date:** [March 2, 2021, 1:13am UTC](https://community.shotgridsoftware.com/t/documentation-on-some-key-rv-python-functions/11706/2 "2021-03-02T01:13:47Z")

</div>

Hi Fabian!

A resource that has proven invaluable for learning and discovering the underlying API of RV has been the `Mu Command API Browser` available in the help menu. For example any functions in `rv.commands` that you have questions about can be searched for by name and their signature & documentation returned.

 ![Screen Shot 2021-03-01 at 10.59.10 AM](https://global.discourse-cdn.com/shotgunsoftware/original/2X/4/45b65304d0a0ad7ec38c9d31a69b9e92e2a6859d.png)

As for you questions:

> [@Fabian](#):
>
> 1. How are the 2 additional parameters in the “getter” functions defined? What do they do? What is their type?

The second and third argument to the getter functions are `start` and `num`, respectively. They act similarly to slicing a python list returning a subset of values from the property’s value-list.

> [@Fabian](#):
>
> 1. Do the “getter” functions always return lists?

Yes, property getters always return a value of type `list`.

> [@Fabian](#):
>
> 1. Do the values always have to be given as a list in the “setter” functions?

Yes, property setters always require a value of type `list`.

> [@Fabian](#):
>
> 1. What does the 3rd parameter mean in the “setter” functions?

The third parameter of a setter function is a `bool` controlling whether the property can resize when set with a value-list of different length than currently set. (The “width” of the value-list is set when a new property is created with `commands.newProperty`.)

> [@Fabian](#):
>
> 1. Are there any additional parameters to these functions?

You’ve got them all! For prosperity, here are the signature for the string property getter and setter:

```auto
setStringProperty (void; 
                   string propertyName,
                   string[] value,
                   bool allowResize = false)

getStringProperty (string[]; 
                   string propertyName,
                   int start = 0,
                   int num = 2147483647)

```

> [@Fabian](#):
>
> 1. Are there any resources online to learn more about the RV python libraries?

Unfortunately there are few online resources for learning about the Python API. The best resources I’ve found so far are the Mu Command API Browser in RV’s help menu and the source of the native plugins supplied with RV.

_Let me know if you have any other questions, cheers!_

---

<div class="post-metadata">

**Author:** ![Fabian](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/fabian/32/3508_2.png) [@Fabian](https://community.shotgridsoftware.com/u/Fabian)\
**Post date:** [March 2, 2021, 9:16am UTC](https://community.shotgridsoftware.com/t/documentation-on-some-key-rv-python-functions/11706/3 "2021-03-02T09:16:47Z")

</div>

Thanks @collinbanko, for the very detailed response! The Mu Command API Browser is a great tip!
