-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using functions from class "Region" #101
Comments
Hi, looks like a typo in the reapy code... Sorry about that and thank you for spotting it. I'll fix it soon and let you know when an update has been pushed. |
I really, really want to finish my job on the #85, but absolutely have no time. It's my dream to have a spare month for the reapy... |
Thanks @Levitanus, I'll check this out then! |
Hi, this bug should be fixed in version 0.9.0. Please upgrade reapy and let me know if anything goes wrong.Thanks again @teetow and @Levitanus for your help in solving this! |
Hi! I have a very small and simple code that should extract the region start time of the indexed region. It looks like this:
import reapy
import reapy.reascript_api as rpr
project = reapy.Project()
Project = reapy.core.Project(None, -1)
Region = reapy.core.Region(project)
test_region = Project.regions[0]
print(test_region.start)
However, when I run this code I get this error:
Exception has occurred: DistError
An error occurred while running a function inside REAPER. Traceback was :
Traceback (most recent call last):
File "C:\Users\oskar.hansson\AppData\Local\Programs\Python\Python38\lib\site-packages\reapy\tools\network\server.py", line 67, in _process_request
result["value"] = request["function"](*args, **kwargs)
File "C:\Users\oskar.hansson\AppData\Local\Programs\Python\Python38\lib\site-packages\reapy\core\project\region.py", line 167, in start
args = self.project_id, self._get_enum_index(), 0, 0, 0, 0, 0
File "C:\Users\oskar.hansson\AppData\Local\Programs\Python\Python38\lib\site-packages\reapy\core\project\region.py", line 28, in _get_enum_index
return next(
File "C:\Users\oskar.hansson\AppData\Local\Programs\Python\Python38\lib\site-packages\reapy\core\project\region.py", line 30, in
if r.index == region.index
NameError: name 'region' is not defined
File "C:\Users\oskar.hansson\AppData\Roaming\REAPER\Scripts\CustomScripts\RegionExpander.py", line 12, in
print(test_region.start)
I tried changing
region.index
in the reapy\core\project\region.py file toself.index
and I even tried going around the whole_get_enum_index()
function but I always get the same error. Is there something I'm doing wrong or is there something weird going on with the API?Note: Other functions like
delete
andadd_rendered_tracks
works just fine. It seems there's something off with the_get_enum_index
function.The text was updated successfully, but these errors were encountered: