Skip to content
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

pyClothingItem index safety and extra properties #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jrius
Copy link
Contributor

@Jrius Jrius commented Jul 23, 2022

pyClothingItem was missing a few things to be properly usable, so I made the following modifications:

  • Added constants pyClothingItem.kNumLODLevels and pyClothingItem.kLayerMax.
  • Added pyClothingItem.numElements getter (as well as matching plClothingItem::getNumElements()).
  • The following will throw an IndexError when appropriate instead of crashing:
    • getElementTexture
    • setElementTexture
    • getElementName
    • setElementName
    • delElement

@@ -198,6 +198,9 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject
/** Add a named element to the clothing item. */
void addElement(const ST::string& elementName);

/** Return the number of elements in the clothing item. */
int getNumElements() const { return fElementNames.size(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return size_t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants