I'm trying to rig my character's legs with IK. The way I set it up seems pretty standart, and I see it in many tutorials: I have a foot controller (IK) bone near the foot, which controlls the shin bone with the chain of 2. I have some constraints so that knee doesnt bend sideways, and for the hip joint as well to limit it's movement. When I test it just like that all constraints work like a charm. However I need some way to control knee orientation, so I add a pole bone to my IK which works out nice, except that the hip constraints are ignored now. Knee constraints still work, but the hip can now bend at any angle imaginable - I can pose character's leg straingt up and so on. Would really love to hear how I can avoid that problem. Also I'm a programmer, so maybe there's some script or something I should look into, I just dont know where to look because I'm new to blender and modelling in general.
Your problem is limiting Ik bones ranges with constraints. You need to use this panel for Ik:
A simple leg Ik rig is here: How to IK rig legs
How to handle pole bones and their angles precisely is here: How to Set/Calculate pole angle of IK constraint so the chain does not move?