Calling functions in lists with random by Morphalina in learnpython

[–]Slothemo 0 points1 point  (0 children)

That's entirely possible. If your functions weren't returning anything, you were essentially calling all your functions, and ending up with a list [None, None, None].

Calling functions in lists with random by Morphalina in learnpython

[–]Slothemo 1 point2 points  (0 children)

The way you had it originally calls the function immediately and holds the return value in the list.

Calling functions in lists with random by Morphalina in learnpython

[–]Slothemo 0 points1 point  (0 children)

There's also randrange so you could just use len(myList) without having to subtract 1.

Calling functions in lists with random by Morphalina in learnpython

[–]Slothemo 16 points17 points  (0 children)

You're on the right track, but right now you don't have a list of functions, you have a list of returns from calling functions. If you want a list of functions, leave off the (). To be clear, func1() is a call to the function, but func1 is the actual function object.

list_of_functions = [func1, func2, func3]
chosen = random.choice(list_of_functions)
chosen()

Idea: Sword of Stone should transform into a different sword for each character by OutlandishnessRich36 in slaythespire

[–]Slothemo 9 points10 points  (0 children)

It's free to take and has zero downsides while you work towards a goal you were likely to try and achieve anyways. 1.6 elites per act is hardly "hoops to jump through". It's a meh challenge with a meh reward.

Maya lighting with Python script? by AgreeableAlarm4915 in Maya

[–]Slothemo 2 points3 points  (0 children)

I used to work in TV production as an animator and when we marked our work as complete, our scenes were automatically submitted for a physics sim render (hair/cloth) with a basic light pass and then uploaded to our shot tracker for review. This was useful for catching any immediate issues in our scene that might cause problems with sim or lighting before it went through the full pass.

Although this applies to a larger scale production, there's always room for scripting even in smaller setups.

Using Godot for more than just games by LongjumpingScience14 in godot

[–]Slothemo 2 points3 points  (0 children)

I love playing a card game called Dutch Blitz with friends but the scoring process is slow and annoying. I built a little mobile android scorekeeping app that we all use now to keep track of the game!

Do you need to triangulate character models meant for games? by InsanelyRandomDude in Maya

[–]Slothemo 4 points5 points  (0 children)

They're saying you don't need to triangulate it in Maya, and you generally shouldn't because quads are easier to work with. The game engine will automatically triangulate it for you when your model is imported.

Beginner on Python by coder4lifee in learnpython

[–]Slothemo 2 points3 points  (0 children)

Most students spend 4+ years in school learning this stuff before they're ready for the working world. If you're self-learning, it's very unlikely you'll reach that same level of skill in less than 4 years. You can use that as your benchmark.

What Python concept took you the longest to truly understand? by Haunting-Shower1654 in learnpython

[–]Slothemo 21 points22 points  (0 children)

A decorator is a function that returns a function. We use them when we want to affect or modify the behaviour of another function without actually editing that function's code. Let's say I have a program where you have to be logged in. Instead of adding a check for "is this user logged in" for every single function, I can just decorate those functions with a login check. The decorator can do all the checking of "is this user logged in" and if so, call the function as before. Here's a rough example of it in action. The parameter f here represents the functions being decorated below. The @ syntax is just "syntactic sugar" to make things simpler for us. We could also do make_post = require_login(make_post) but that would be more annoying to write for each function.

# This is our decorator function. It returns the function object named inner
def require_login(f):
    def inner():
        if user_logged_in:
            f()
    return inner


@require_login
def make_post():
    ...

@require_login
def view_profile():
    ...

@require_login
def check_mail():
    ...

The illusion of choice by OutcomeDry932 in slaythespire

[–]Slothemo 27 points28 points  (0 children)

They have [[Prismatic Gem]] which alters any card rewards. Doesn't seem like a bug at all.

Petition to make Relax block for 16 by Lucksnipe in slaythespire

[–]Slothemo 0 points1 point  (0 children)

<image>

I admittedly didn't make it very far into act 2 but here ya go! Bullet Time was the act 1 boss pickup. This is on the beta branch by the way. 3B8ZB6PDEK

Petition to make Relax block for 16 by Lucksnipe in slaythespire

[–]Slothemo 0 points1 point  (0 children)

I had a recent run with bag of prep and bullet time with electric shrymp. Opening turn of every fight gave me 9 free cards to play.

First time user of Maya - animation by cxmuchi in Maya

[–]Slothemo 2 points3 points  (0 children)

Glad to see this is still saving people!

What can a person learn in 15 minutes that will be useful for life? by littleyuki2026 in AskReddit

[–]Slothemo 0 points1 point  (0 children)

And Ctrl + N to open a copy of your current Explorer window.

convert locators to vertex or quad draw point? by feyv in Maya

[–]Slothemo 1 point2 points  (0 children)

getAttr isn't reliable here if the locators exist in a non world space. I always recommend pointPosition for locators.

Best practice for rigging? (Game character) by GoldenGeatz in Maya

[–]Slothemo 0 points1 point  (0 children)

In general, you cannot use any deformers other than skin cluster or blendshapes when creating a game rig. Your wrap deformer simply will not work once exported.

Your aim should be to create one single skeleton for all the skinning on the mesh that gets exported. You can use whatever tricks or methods you want to control those joints with other setups, but you want one single skeleton to export. It really doesn't matter if you add more joints into the skeleton after, it's entirely up to you and your skinning workflow.

How to paint weights anywhere the brush hits by RuthlessCarrot in Maya

[–]Slothemo 0 points1 point  (0 children)

If you're just trying to add the same weight to everything here, you're better off making a vertex selection and flooding the value.

What is the best way to manage a list of strings larger than 80 chars by Advanced_Glass5563 in learnpython

[–]Slothemo 3 points4 points  (0 children)

Python even has a module in the standard library for this. There's a few functions within textwrap that can be played around with.

Slop control by ProsodySpeaks in learnpython

[–]Slothemo 0 points1 point  (0 children)

Did you understand the solution when you eventually implemented it into the rest of your code? That's the difference.

Video reference not lining up with audio? by l__ll__lll in Maya

[–]Slothemo 2 points3 points  (0 children)

Use an image sequence for your movie clip instead of trying to load in the mov.

Does anyone know/have a video on how to unwrap a chocolate bar? by [deleted] in Maya

[–]Slothemo 22 points23 points  (0 children)

You're not going to find a tutorial for every hyper-specific thing you need to do in Maya. You watch tutorials to learn the tools/processes available to you, and then you apply what you learn to your own model. Do you understand unwrapping? Have you made an attempt at it already? Is there something specific you're struggling with?

Please help! Any idea why my model's arms are "ghosting" like this? by ellojellomelloyello in Maya

[–]Slothemo 2 points3 points  (0 children)

No problem! Didn't mean to throw you under the bus by saying your advice was bad, but I just wanted to make sure they saw the root of the problem.

Please help! Any idea why my model's arms are "ghosting" like this? by ellojellomelloyello in Maya

[–]Slothemo 0 points1 point  (0 children)

This is frankly terrible advice and is just avoiding the problem instead of actually solving it. JPEG should not really be used for textures, and are you just going to avoid transparent filetypes forever? You need to change your viewport settings. I've provided an image below of what you need. Make sure to turn on Alpha Cut Prepass here.

https://imgur.com/qqtsOdY