gr4ph0s / C4D_RedshiftWrapper_API

A c4d wrapper around Redshift API
MIT License
35 stars 7 forks source link

'doc' not defined in plugin context #2

Closed knekke closed 5 years ago

knekke commented 6 years ago

Hi, thanks for the wrapper! I have a tiny problem when I try to include your wrapper into a plugin. As a standalone script everything runs fine, but in a plugin context I get: global name 'doc' is not defined when I run rs.CreateMaterial() I'm pretty new to c4d, so no idea why it makes a difference.

gr4ph0s commented 6 years ago

Thanks I will fix it later today. :)

knekke commented 6 years ago

btw what command did you run for the pyminifier? It seems the only way to include the imports is pyz, but that is not what you used...?

gr4ph0s commented 6 years ago

Fixed, Do you need a minified version also? About pyminifier, I do it manually by merging all files of the module within one python file and then I simply run pyminifer as default

knekke commented 6 years ago

All good, I have it working now. I had to change line 255 in Redshift.py to: if not isinstance(doc, c4d.documents.BaseDocument) and doc is not None:

Thanks!

drewyeaton commented 5 years ago

Hey guys, I've created a pull request for the suggested fix above: https://github.com/gr4ph0s/C4D_RedshiftWrapper_API/pull/3

Great work on this project!

gr4ph0s commented 5 years ago

Thanks a lot guys, I should have more personal time this year (at least this month I get more).

So I will try to update with the current rs state within the week (it's been a while since I looked to rs, stuff may have changed)