@rig-c/review 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -65,6 +65,8 @@ export function selfTargetRefusal(r:{kind:RequirementKind;bone?:string;point?:Bo
|
|
|
65
65
|
if(r.kind==='aim'&&r.target.bone===r.bone)return `REQUIREMENTS_SELF_TARGET: aim of bone "${r.bone}" at its own ${r.target.point} has no line to measure; pick another target bone`;
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
+
/** The catalog the form renders from: only a ready rig spec. An unavailable one (no producer handoff) is no catalog, so picking a part with no handoff never renders fields from it (#150). */
|
|
69
|
+
export function readyCatalog<C extends {status:'ready'|'unavailable'}>(next:C|null):C|null {return next&&next.status==='ready'?next:null;}
|
|
68
70
|
/** The target a fresh form proposes: a bone other than the subject (the next one in rig order, else the first other one). */
|
|
69
71
|
export function defaultTargetBone(bones:readonly string[],subject:string):string|null {
|
|
70
72
|
const i=bones.indexOf(subject),next=i>=0?bones.slice(i+1).find(b=>b!==subject):undefined;
|
|
@@ -201,7 +203,8 @@ export function bindRequirementsPanel(deps:RequirementsPanelDeps):RequirementsPa
|
|
|
201
203
|
|
|
202
204
|
const panel:RequirementsPanel={
|
|
203
205
|
load(next,reason){
|
|
204
|
-
catalog
|
|
206
|
+
// Only a ready spec is a catalog: an unavailable one (no producer handoff, #150) leaves the form empty, so selecting a part never renders fields from it.
|
|
207
|
+
catalog=readyCatalog(next);
|
|
205
208
|
if(!next||next.status!=='ready'){state.textContent=reason??next?.reason??'REQUIREMENTS_UNAVAILABLE: no producer handoff';state.classList.add('error');kind.disabled=animation.disabled=true;add.disabled=check.disabled=true;fields.replaceChildren();return;}
|
|
206
209
|
state.textContent=`Rig spec: ${next.bones.length} bones, ${next.slots.length} slots, ${Object.keys(next.meshes).length} mesh slot(s), ${next.constraints.length} ik/transform constraint(s), ${next.animations.length} animation(s)${next.scratch?' · a scratch build exists':''}.`;state.classList.remove('error');
|
|
207
210
|
kind.disabled=animation.disabled=false;
|