MCPcopy Create free account
hub / github.com/ImageEngine/cortex / _applicableTo

Method _applicableTo

python/IECore/BasicPreset.py:531–581  ·  view source on GitHub ↗
( self, parameterised, parameter, data )

Source from the content-addressed store, hash-verified

529 return parameter.getClass( parameterName, True )
530
531 def _applicableTo( self, parameterised, parameter, data ) :
532
533 if parameter.staticTypeId() == IECore.TypeId.CompoundParameter :
534
535 if "_classValue_" in data or "_values_" in data:
536 return False
537
538 for k in data.keys():
539 if k not in parameter:
540 return False
541
542 elif isinstance( parameter, IECore.ClassParameter ) :
543
544 if "_className_" not in data:
545 return False
546
547 classNameFilter = "*"
548 try :
549 classNameFilter = parameter.userData()["UI"]["classNameFilter"].value
550 except :
551 pass
552
553 if classNameFilter != data["_classNameFilter_"].value:
554 return False
555
556 elif isinstance( parameter, IECore.ClassVectorParameter ) :
557
558 if "_classNames_" not in data:
559 return False
560
561 classNameFilter = "*"
562 try :
563 classNameFilter = parameter.userData()["UI"]["classNameFilter"].value
564 except :
565 pass
566
567 if classNameFilter != data["_classNameFilter_"].value:
568 return False
569
570 if data["_classSearchPaths_"].value != parameter.searchPathEnvVar() :
571 return False
572
573 else :
574
575 if "_value_" not in data:
576 return False
577
578 if not parameter.valueValid( data["_value_"] )[0]:
579 return False
580
581 return True
582
583 @staticmethod
584 def _pruneHierarchy( data ) :

Callers 1

applicableToMethod · 0.95

Calls 5

staticTypeIdMethod · 0.80
searchPathEnvVarMethod · 0.80
keysMethod · 0.45
userDataMethod · 0.45
valueValidMethod · 0.45

Tested by

no test coverage detected