-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix for string attributes default values #39
fix for string attributes default values #39
Conversation
benblo
commented
Nov 4, 2020
- see attributes' default value not saved in scene #34
- handles Compounds recursively
- see mottosso#34 - handles Compounds recursively
Let's add a docstring test to this, something that..
|
I'm not aware of docstring tests, is that a type of unit-test? is there a specific syntax?
|
Any function/method with a Anything following a >>> 5 == 5
False This test translates into >>> var = 5
>>> var
5 This test succeeds. Etc. |
Got it, I added the test. |
Ahahah awesome :), this is a great CI pipeline you got there! Still failing though. I understand Maya2015's failure (seems to not find the plug, don't know why), but I don't understand it for Maya2020: it's re-opening the scene and then... nothing? https://mottosso.visualstudio.com/cmdx/_build/results?buildId=890&view=logs&j=fba502cc-81c4-5a7b-0b6c-e040a5b5b330&t=10abd179-32b1-54ec-572c-7ab220df8c4d&l=169 |
Oooh I see, it's failing right at the start!
|
Well, I'm at a loss... the test runs fine on my Maya, but it looks like it's not finding the plug: |
Failed example:
sphere["my_string"]
Expected:
"foo"
Got:
foo Some Maya's are less forgiving and more secretive in their error messages. Keep in mind that what's being printed there is a stringification of |
Well, there you have it:
Passes the first time, fails after scene reload (line 5156). AFAICT this is the first test in the codebase that tries to save & reload a file so I must be hitting some shenanigan here... |
Haha, oh wow. Wouldn't like to be you right now. xDD
Print it. :) if fail:
with open("somescene.ma") as f:
print(f.read()) That'll give you the contents in the test page. There are probably other ways in which to upload artifacts in the CI system for download later, but I bet that's a rabbit hole. |
I hope this is not a more serious issue of node-reuse thinking that nodes from a past scene are accessible from the newly opened scene. I would expect memory violations from that. It really shouldn't, as the uniqueness comes from their hash which should be as unique as their memory address. |
Well, the "my_string" attribute is indeed there, so shenanigan it is... (I actually have had some crashes in the context of destroying/recreating a bunch of nodes with the same name, which I felt could be due to node/plug reuse... I was hoping to get to those subjects once the pleasantries were done...) |
Hmm... so some tests pass, some don't, seems very random. |
Yay, one success... well, I think this makes it pretty clear that the attribute is indeed saved (just grep "my_string" in the failure cases, it's in the .ma for sure), but the node/plug is invalid. I'm gonna try to disable caching and see what happens. |
Well, that didn't help, now 2020 is the only one passing (was 2016 last time)... this feels very random. |
So I just figured out that I didn't set the CMDX_SAFE_MODE env var correctly (needs to be "True/False", "1/0" doesn't work...) |
Sorry you have to go through this, debugging CI is a pain. You can run these locally though, so don't forget that. Either if you've got Docker installed locally, or by heading to https://labs.play-with-docker.com/ You'll find commands you can use from the CI config here which you can likely put into a Bash script or the like to speed things up. |
Aaah, Docker... I'm on Windows here man ;) ! If I push commits to my own fork (without a PR), does that trigger CI as well? |
I'm on Windows as well. :) Docker runs on Windows, and also on WSL2. But, you don't need any of that, the play-with-docker website let's you launch the Docker container - which is like launching a terminal into another machine - used by the CI from your browser, where you can call commands as though it was your local machine. And you won't need to replicate any setup beyond having access to the Once you're done pulling your hair out fighting CI, take 10 mins to run through a tutorial. You won't regret it.
No, but you're welcome to make PRs to trigger builds, even if you don't intend to merge them. Just put something in the description to avoid mistakenly merging it. |
So... I can just tell some docker somewhere in the cloud to pull a fully-featured VM image, with Maya installed etc? What about licenses? |
Can't merge this one until tests are happy. |
@benblo I'm also having a few issues with crashes where Maya isn't giving you much intel on why. I'm curious about your experience in the past few months, whether you've got any new insights or debugging tricks? This crashing issue still eludes me personally, and I have a few that I think may be related but are having trouble narrowing down. |
Crashes have become much, much less frequent for me (my deleteAttr fix has definitely paid off), now I'm only having the odd crash when switching scenes, which is still annoying but not workflow-disrupting so I haven't even tried investigating yet. I've been working on UI a lot lately, and Qt just loooves to crash when you give it badly typed data (eg pass a float to a I definitely need to PR some more fixes your way, but I've been buried for over a month figuring out some insane transform issues in some of our rigs, which I finally nailed yesterday so yay! I can finally move on to other stuff. |
Yes, I'm having similar thoughts about cmdx, of making a compiled version where we expose critical parts of the API myself rather than relying on
Awesome, that would be great. I'm working on a too-large PR at the moment with everything and the kitchen sink in it - #52. I'm just struggling with the Azure pipeline no longer working with Docker (apparently) so am moving to GitHub Actions. Another CI platform, another file syntax, and still no means of testing the script before pushing. It's a lot of fun (not). xD
Incorrect how? Wouldn't |
In fact I suspect the primary reason for crashes on my end are strings. Creating them, editing them, deleting them. How is your current experience with strings? Are you using them a lot? |
@benblo I just discovered that there are debug symbols for Maya! :OOOO They are not public, they are hosted under the Autodesk Developer Network, which is free. So yeah, sign up for that. It's a solid 5GB of debug symbols. Just giving these a go now. |
Regarding validating marshalling (Qt, OpenMaya, etc): overall, typing is the #1 thing that I hate about Python. I'm constantly guessing what functions want, casting stuff, printing stuff just to see what their type is; so infuriating when statically-typed languages solved this issue 50 years ago. But on top of that, Autodesk did a very shoddy job with the Python bindings, so much of the API is exposed as BTW, this is also why I've added Re string crashes: yes I'm using them. On every scene I have a dozen nodes with a couple strings attributes I'm frequently reading from/writing to, I haven't seen issues with it. I have that fix locally though, so maybe that helps. Re symbols: hmm... pretty sure ADN is where I downloaded the devkit to begin with, how did I miss the symbols?!? You mean there right: https://adn.autodesk.io/ ? Now I can't seem to log on, that's weird...
That's the thing, that node isn't keyed so its value is the same at t0 vs tCurrent. |
Haha, yes. Having implemented a few of those via their provided C++ API, I can see why they do that. Each command has a ton of boilerplate associated with it, and you basically want to squeeze as much into each command as you can. Using arguments as sub-commands. It's very aweful. But it goes back to the MEL days, which is still how scenes are serialised to disk. Python was added later and this is one area which doesn't lend itself well to it.
That is true, they should return "native" cmdx types. PR is welcome.
Yes, hah. It's very well hidden. Known as a "Special Download". |
Hi! I'm reviving this topic :), trying to solidify our Maya pipeline here... I still can't figure out how to get an ADN account! |
Haha, a little out of scope for a GitHub PR, but it's the ADN Standard here. The secret is in the finetext below.
If you've got a company/studio, and you develop for Maya, this is you. :) |
Closing this for now as the main branch has deviated too far from this PR. Feel free to reopen this if a solution is found, it's still an active problem. |